Jan
18
2012

How to Blackout your WordPress/Website in Protest of SOPA & PIPA

On Wednesday Jan. 18,  Wikipedia and many other websites will black out their content in protest of the (SOPA)Stop Online Piracy Act, the (PIPA)Protect Intellectual Property Act  and the (OPEN)Online Protection and Enforcement of Digital Trade Act .

So, now days most of website owner and bloggers are worry about their websites and blogs protecting from SOPA.

How to Blackout your WordPress/Website in Protest of SOPA & PIPA?

Here are some basic tips, though maybe his most important piece of advice is to keep things simple. Don’t mess up with your DNS settings, don’t try to be too clever for your own good. You only want to participate in the blackout for one day, after all, and not suffer the SEO consequences for months to come.

1. SOPA Blackout Plugin for WordPress

This plugin allows you to set SOPA blackout dates for your WordPress website, as well as a variety of options on who the anti-SOPA is shown too. You can have it shown instead of your site for any visitor, you can only show it the first time then let your visitors continue to the site, plus a lot more. This plugin is SEO friendly with temporary redirects being used.

By default, this plugin will automatically redirect visitors from your site’s home page to a “Stop SOPA” message on Jan. 18 and 23, 2012. After the visitor has seen the Stop SOPA message, they will be able to continue to your site and will not see the message again during that browser session. There are a number of options available to customize the way the plugin behaves

2. SOPA Blackout JS Utility – The Easy Way

We’ve created a very easy way to Blackout your WordPress/Website in Protest of SOPA . Please put the following HTML snippet just above the closing  </body> tag on your website’s front page:

 

The following will present a blackout banner when users visit your site, which can be circumvented by clicking anywhere:

 

1
<script type="text/javascript" src="//js.sopablackout.org/sopablackout.js"></script>

 

The following will blackout an element of a specific id:

 

1
2
<script type="text/javascript">sopablackout_id = 'sopa';</script>
<script type="text/javascript" src="//js.sopablackout.org/sopablackout.js"></script>

4. WordPress Plugin

Sasha Gerrand kindly created a wordpress plugin to easily implement this. Check it out on github.

5. 503 Header

A 503 message is very similar, but it tells Google and other search engines that this is just a temporary outage. If you know how long the outage will last, you can even tell Google when to start indexing your page again.

For example, instead of returning an HTTP result code 404 (Not Found) or showing an error page with the status code 200 (OK) when a page is requested, it’s better to return a 503 HTTP result code (Service Unavailable) which tells search engine crawlers that the downtime is temporary. Moreover, it allows webmasters to provide visitors and bots with an estimated time when the site will be up and running again. If known, the length of the downtime in seconds or the estimated date and time when the downtime will be complete can be specified in an optional Retry-After header, which Googlebot may use to determine when to recrawl the URL.
Returning a 503 HTTP result code can be a great solution for a number of other situations. We encounter a lot of problems with sites that return 200 (OK) result codes for server errors, downtime, bandwidth-overruns or for temporary placeholder pages (“Under Construction”). The 503 HTTP result code is the webmaster’s solution of choice for all these situations. As for planned server downtime like hardware maintenance, it’s a good idea to have a separate
server available to actually return the 503 HTTP result code. It is important, however, to not treat 503 as a permanent solution: lasting 503s can eventually be seen as a sign that the server is now permanently unavailable and can result in us removing URLs from Google’s index.

Implementing a 503 header page isn’t too difficult, though the details will vary according to which technologies power your site. If you’re using WordPress there’s a SOPA Blackout plugin available that can handle the blackout for you. It’s also pretty easy to create a 503 redirect at the server level. If you use Apache ensure that you have the Rewrite module installed and then add something like the following code to your root .htaccess file:

1
RewriteRule .* /path/to/file/myerror503page.php

That will redirect your entire website to the 503 error page. Now just make sure that your myerror503page.php page returns a 503 error. Assuming you’re using PHP, something like this will do the trick:

1
2
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Retry-After: Thu, 19 Jan 2012 00:00:00 GMT');

You can read more about this here and you can find some basic instructions for how to set a 503 header here.

 

Don’t Mess With Your Robots.txt File

Far also tells webmasters what to do with their robots.txt file – the document that tells search engines how to (and how not to) index a page. His basic advice is to just leave the file alone. Just make sure your robots.txt file’s status code isn’t a 503.

 

Please help us to sharing this post and protest your friends website/blog  Blackout from SOPA.

You may be interested in

About the Author: Ajay Patel

I am Ajay Patel a 21 year old Entrepreneur blogger, Founder and Editor of "WebDesignerGeek". I am passionate about web and mobile development.I loves playing around with the latest technologies in our industry. I works mostly in PHP and CMS like WordPress, Joomla.Now working as Web  & Mobile App Developer. You can follow me on @twitter and @facebook

8 Comments + Add Comment

  • Hey Ajay, I was searching for it. Your posts and information are fabulous to read. SOPA and PIPA are ending our liberty, not piracy.

    • Yes, sure. Assume the world without Wikipedia and WordPress.
      STOP SOPA

  • [...] It was easy.  I placed the following javascript right above the </body> tag on my pages. ‘<script type=”text/javascript” src=”//js.sopablackout.org/sopablackout.js”></script>’ and it worked like a charm, thanks to this site. [...]

  • May I use the image at the top of this post on my blog?

    • Yes you can :) This images are free to STOP SOPA

  • Dude… Its Obvious dat Internet was created for Educating in goo faith.. Now this Act is snatching the liability of the users and most important this is done by some stupid bunch of congress who hardly even knows how to operate a keyboard!!!! Dis is Phukhing Insane……….

Leave a comment