Making a canonical WordPress site; duplicate content fix

Check that slick looking URL out, it took some fiddling and an hour of downtime to get this site to the stable state it is now in. Here’s the run through of how to convert your http://www.* format site URL (http://www.michaelvisser.com.au) to a single canonical source http://* (http://michaelvisser.com.au) for SE spiders.

Update your WordPress site details

  1. Login as an Administrator within your blog back-end (eg. http://www.michaelvisser.com.au/wp-login)
  2. Open the Options page
  3. Within General Options update the WordPress address (URL) and Blog address (URL) to reflect your new address (eg. http://michaelvisser.com.au)
  4. Submit changes by clicking Update Options
  5. Sign out of your WordPress back-end

Apply the http://www.* 301 Permanent Redirect condition

  1. Open your .htaccess file (within in the root of your site directory, eg. /public_html/michaelvisser/)
  2. If you have Permalinks (Search Engine Friendly URL, eg. http://www.michaelvisser/about) active on your blog paste the following code immediately under the line beginning “# BEGIN WordPress<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
    RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
    </IfModule>
  3. Save and close your .htaccess file

Test everything!

  1. Refresh any session cookies by closing your current browser window and reopening a new session (eg. Firefox, Internet Explorer)
  2. Return to your WordPress site using the new address (eg. http://michaelvisser.com.au)
  3. Themes developers often implement different linking structures so check a variety of content in your testing process, including:
    • pages
    • categories
    • search features
    • comment submission
    • feedback requests
    • any custom functionality
  4. Log in as an Administrator and test any privileged site features, including:
    • Edit this post
    • Mark as spam
    • Delete this post
  5. Sign out from your privileged account

Let the people that matter know!

This is a simple process but will require the most effort and perseverence.

  1. Open Google’s Advanced Search to generate an inbound link search of your site
  2. Within Page-Specific Search enter in Links your site address (eg. http://www.michaelvisser.com.au)
  3. All of the pages listed need to be notified of your updated URL, you can do this by:
    • Contacting the site owner directly if the link has been manually applied
    • Logging in and updating your profile information within member profiles

Hope this helps! Thanks go out to Joseph Crawford for his post on the no-www movement and redirection code snippet.