How to Avoid the Duplicate Content Penalty

[et_pb_section bb_built=”1″ admin_label=”section” transparent_background=”off” allow_player_pause=”off” inner_shadow=”off” parallax=”off” parallax_method=”off” custom_padding=”20px|||” padding_mobile=”on” make_fullwidth=”off” use_custom_width=”off” width_unit=”on” make_equal=”off” use_custom_gutter=”off”][et_pb_row admin_label=”row” make_fullwidth=”off” use_custom_width=”off” width_unit=”on” use_custom_gutter=”off” custom_padding=”0px|||” padding_mobile=”on” allow_player_pause=”off” parallax=”off” parallax_method=”off” make_equal=”off” parallax_1=”off” parallax_method_1=”off” column_padding_mobile=”on” background_position=”top_left” background_repeat=”repeat” background_size=”initial”][et_pb_column type=”4_4″][et_pb_text admin_label=”Text” background_layout=”light” text_orientation=”left” use_border_color=”off” border_color=”#ffffff” border_style=”solid” custom_css_before=”.et_pb_section .et_pb_section_1 et_section_regular {|| padding-top: 0% !important;||}” background_position=”top_left” background_repeat=”repeat” background_size=”initial”]

We’ve been building out content fast and furious lately, always with an eye towards SEO. However, we recently discovered a problem in the technical SEO on one of our sites. An audit using the tools at SEMRush showed the potential for a duplicate content penalty from Google.  Here’s how you prevent Google and the other search engines from dinging you for duplicate content on a WordPress website.

[/et_pb_text][et_pb_text admin_label=”Text” background_layout=”light” text_orientation=”left” use_border_color=”off” border_color=”#ffffff” border_style=”solid” custom_css_main_element=”.et_pb_text ul, .et_pb_text ol { margin: 50px; }||.et_pb_text li { margin-top: 100px; }” background_position=”top_left” background_repeat=”repeat” background_size=”initial”]

First, CHOOSE how you will serve your website, either using the natural URL or the WWW subdomain.  For example, choose either https://blueskydigitalstrategy.com/ OR https://www.blueskydigitalstrategy.com/  Both are valid.  But, if you don’t tell Google which one you want to use AND you don’t redirect the one you don’t want to use to the one you do, both will be indexed as unique sites.  Voila, you have duplicate content.  Furthermore, Google will distribute your website’s “juice” between the two “sites,” effectively diluting your killer content and making it harder for you to rank.  All that keyword research will be rendered useless.  Try Googling “canonical programming” if you want to know more.

Once you’ve made your choice, TELL Google which one you prefer.  This means going into your Google Search Console, adding both versions of the website (and the http:// and https:// versions, too), verifying your ownership, and selecting the one you prefer (e.g. https://blueskydigitalstrategy.com).  You’ll typically have four separate properties in the GSC, so group them into a property set.  A property set will show you aggregate data for all its member properties.  Select a single website property within the property set, and then click on the gear symbol in the upper right of your GSC.  In the dropdown menu, select “Site Settings.”  This will give you the option to select a “Preferred domain” (or no preference; don’t do this).  When Google finds a link back to your site such as http://www.example.com, it will consider it exactly the same at http://example.com, or vice versa.

[/et_pb_text][et_pb_image admin_label=”GSC Image” src=”https://blueskydigitalstrategy.com/wp-content/uploads/2016/08/Google-Select-Non-WWW-1.jpg” alt=”Avoid Duplicate Content Penalty” title_text=”Avoid Duplicate Content Penalty” show_in_lightbox=”off” url_new_window=”off” use_overlay=”off” animation=”left” sticky=”off” align=”center” force_fullwidth=”off” always_center_on_mobile=”on” use_border_color=”off” border_color=”#ffffff” border_style=”solid” custom_margin=”||80px|” /][et_pb_text admin_label=”Force non-WWW version of site” background_layout=”light” text_orientation=”left” border_style=”solid” background_position=”top_left” background_repeat=”repeat” background_size=”initial” _builder_version=”3.0.51″]

To Force Non-WWW

 

To create a 301 (permanent) redirect to the non-WWW version of your site, you’ll need to insert the following code (http://www.example.com redirects to http://example.com):

 

# BEGIN WordPress
<IfModule mod_rewrite.c>

RewriteEngine On
# Force non-www (MUST be ABOVE WordPress RewriteRules) #
RewriteCond %{HTTP_HOST} ^(www.) (.*) [NC]
RewriteRule ^ http://%2%{REQUEST_URI} [L,R=301]
or
# Force non-www (MUST be ABOVE WordPress RewriteRules) #
RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
RewriteRule ^(.*) http://example.com/$1 [L,R=301]

RewriteBase /
... </IfModule>


[/et_pb_text][et_pb_text admin_label=”Force WWW version of site” background_layout=”light” text_orientation=”left” border_style=”solid” background_position=”top_left” background_repeat=”repeat” background_size=”initial” _builder_version=”3.0.51″]

To Force WWW

 

To create a 301 (permanent) redirect to the WWW version of your site instead, you’ll need to insert the following code (http://example.com redirects to http://www.example.com):

 

# BEGIN WordPress
<IfModule mod_rewrite.c>

RewriteEngine On
# Force www (MUST be ABOVE WordPress RewriteRules) #
RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
or
# Force www (MUST be ABOVE WordPress RewriteRules) #
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301,NC]

Rewrite /
... </IfModule>

[/et_pb_text][et_pb_text admin_label=”Text” background_layout=”light” text_orientation=”left” use_border_color=”off” border_color=”#ffffff” border_style=”solid” background_position=”top_left” background_repeat=”repeat” background_size=”initial”]

Now you’re ready to test your configuration.  Just plug the URL to be redirected into your browser of choice.  If it doesn’t redirect, clear your cache and try again.  Once you’ve got your configuration correct, you’re all set to avoid the Duplicate Content Penalty.

Avoid the Duplicate Content Penalty using Apache httpd.conf

A more elegant way to accomplish the 301 redirect is to modify your httpd.conf file, if you have access to it.  This is an Apache file, so you’ll have to restart Apache to have the changes take effect.  Typically, this file is found under /etc/apache2/sites-enabled/httpd.conf or something similar.  Check with your host for the specifics.  You’ll want to add the following lines to redirect non-www to www:

<VirtualHost *:80>
    ServerName example.com
    Redirect permanent ^/(.*) http://www.example.com/$1
</VirtualHost>

And, you’ll want to add these lines to redirect www to non-www:

<VirtualHost *:80>
     ServerName example.com
     Redirect permanent ^/(.*) http://example.com/$1
</VirtualHost>

Don’t forget to restart Apache via:

sudo service apache2 restart

[/et_pb_text][/et_pb_column][/et_pb_row][/et_pb_section]

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top
Call now!