Big Bucks Blogger

Lucia Liljegren comments on blogs about making money blogging.

Optimize Wordpress for Search:
No more sercret duplicate content!

If you are monetizing your blog, or just want lots of traffic, you need to organize your Wordpress templates so that search engines give you the highest possible rank. We all know that one of the things you must avoid is duplicate content. But did you know that Google may think you have duplicate content even though you don't?

Well, you might. It turns out there is a teeny, tiny thing you can do that will eliminate pesky hidden duplicate content.

Today's optimization tips will help you avoid duplicate content and make your pages a bit more crawlable. After you implement it, you will hardly notice any difference in how your blog loads. But it will make a big difference to spiders.

What will happens? Well, normally, if you can load a blog post using either of these two addresses:

  1. http://money.bigbucksblogger.com/hide-sponsored-categories-plugin/
  2. http://money.bigbucksblogger.com/hide-sponsored-categories-plugin

That's fine for a human being; the don't notice one address ends with '/' and one doesn't. However, Google considers the two address to be two pages. So, as far as Google is concerned, you blog has duplicate content. That means lower page rank. That means fewer Pay Per Post opps!

Can I eliminate the duplicate content?

Yep! You can redirect one of the address to the "other" address. Users can still enter either addresses and get to the right place. But the spiders will now know there is only one page.

Make the fix, follow these two steps:

  1. copy code in the text box below.
  2. Where to paste the SEO scriptPaste the code into the very top of your header.php file. (This is the "header" file in your template directory.) Do not leave any blank lines before or after the code. If you want a better view of where to put the code, click to enlarge the image to the right. After pasting in the code, click update to save your changes.

You are finished !

Still, do check your blog still works. Small things can break this. For example, some browsers change quotes 'a' into this `a`. See, the second quotes slant? (The reason I reiterate Sebastians tip's with a few changes was to make it easier for beginners to cut and paste the code with fewer glitches. I made two other minor changes.)

If your blog broke strip out the code (it probably won't) and ask someone for help!

Now visit some individual posts. Delete the trailing '/' from a url and reload. Wordpress should now add the '/'.

Whoo hoo! Duplicate content fixed!

Do you want to learn more SEO secrets you can use to improve your traffic and page rank?

Visit Sebastian's pamphlets great tips at optimize Wordpress for search engines. I'll be implementing most of these at my blogs.

If you understand his information rich directly, you should go there first. Because I ran into a few snags copying just cutting and pasting quotes, and with a couple of other minor things. I know php so I was able to modify things just a bit to make it easier to cut and paste.

Over the course of the week, I'll do the same for each tip and explain in my own words why you should use the modifications he suggests. When it helps. I'll also provide the code with minor modifications that I made to eliminate the snags I ran across.

Tags:  

If you like my post, please use click orange to subscribe, green to bump or blue to sphinn! Better yet, Stumble using your toolbar. :)


Related Posts:

Comments

27 Responses to “Optimize Wordpress for Search: No more sercret duplicate content!”

  1. Sebastian (11 comments.) on September 4th, 2007 12:47 pm

    Thanks Lucia, you caught me. ;) Sometimes I’m a lazy coder, and when I post code I often write two or three statements instead of one for better readability. Can’t wait for your next post. :)

    As for the canonicalization tip above, it can break the site search facility when the template designer has referenced ‘./index.php’ instead of ‘./’ in the sidebar’s form element (sidebar.php). Best replace the action URL with get_bloginfo(’url’) plus trailing slash if needed, because absolute URLs are always better.

  2. Lucia on September 4th, 2007 1:28 pm

    I only “caught” you because I’m a worse programmer! But, strangely, I’m a better programmer than loads of people. So, I’ve learned that if I hit a snag, other people will too. Then they won’t know the problem is the straight up and down “s and ’s all replaced by the “pretty” slanted ones.

    I’ll get that other bit changed.

    When I read your post, my first thought was: this ought to be a plugin so that the non-programmers don’t need to cut and paste. Then, I realised: Darn, there’s no hook for this type of change!

    Your post has great tips!

  3. Sebastian (11 comments.) on September 4th, 2007 1:45 pm

    Thanks :)

    Can’t you write a plugin to prevent WordPress from replacing wonderful plain single and double quotes within code/pre tags with fancy crappy stuff stolen from M$-Word? ;)

    I’d rather use that than ugly text areas. You made a valid point though.

    If template designers would implement this stuff … sigh … they’re mostly designers and not SEO savvy coders. :(

  4. Lucia on September 4th, 2007 1:50 pm

    I probably could write that plugin– assuming Wordpress doesn’t “prettify” too late.

    The blog author has to promise to use the &ltcode> tags. Also, to save CPU, I might add a feature that let them tell Wordpress to only search for code in posts you put in a “code” category or tag somehow, but it could be done! Neither of these are onerous because people who actually write code can easily understand the need to insert tags.

  5. Kristie (2 comments.) on September 4th, 2007 1:59 pm

    Hmmm. I never realized that was a problem. I’ll have to run off and add the code to my blog. I’ll be back if I can’t make it work. Thanks!

  6. Blog Strokes (8 comments.) on September 4th, 2007 6:57 pm

    @ Sebastian, This does that and a lot more. http://blog.igeek.info/wp-plugins/igsyntax-hiliter/

  7. Make Sure Your Wordpress Blog Serves The Right Page The Right Way | Blog Strokes on September 4th, 2007 10:24 pm

    […] ( Crochet Jane ) posted a code fix for the trailing slashes problem (If you ain’t subscribed to Lucia’s blog, there is just something wrong with […]

  8. Sebastian (11 comments.) on September 5th, 2007 1:34 am

    @Blog Strokes
    Looks good but I can’t activate it in WP 2.2.2 coz it produces a fatal error.

  9. Sebastian (11 comments.) on September 5th, 2007 2:53 am

    Lucia, here is a the plain PHP code. Thanks for the heads-up.

  10. Blog Strokes (8 comments.) on September 5th, 2007 5:52 am

    @Sebastian,
    Probably a plugin conflict. I have it running in 2.2.2 with no modification.

  11. Joyangel123 (1 comments.) on September 6th, 2007 9:45 pm

    hmmmm, i find this quite fascinating and clever. Great job and good luck with it all

  12. Chino Yray (1 comments.) on September 11th, 2007 8:35 am

    Thanks for this tip. I didn’t know google flags your blog on duplicate contents.. I may not have duplicates but most of the time, I quote from my previous posts.

  13. Lucia on September 11th, 2007 8:46 am

    @Chino: Quoting is ok. It’s having posts that Google thinks are 100% identical that’s a problem.

  14. Will (6 comments.) on September 14th, 2007 11:06 am

    I copied and pasted the code into my header file, but it broke the site. When I do the test of entering the url without the /, instead of inserting it and loading the page, I just get a blank page.

    I just reloaded the original header file, so now the site works, but I would like to be able to implement this. Thanks!

  15. Will (6 comments.) on September 14th, 2007 11:45 am

    I put the code (before / changes), from my header php file in the WP Pastebin if anyone wants to look at it and see if it is apparent why this optimization tip won’t work on my site.

    http://wordpress.pastebin.ca/697772

    .

  16. Will (6 comments.) on September 14th, 2007 11:50 am

    And here is a Pastbin with the header php code after I copy and paste it in. (This is the php file that won’t work).

    Thanks for any help.

    http://wordpress.pastebin.ca/697775

  17. Lucia on September 14th, 2007 1:02 pm

    Will,
    Normally, the header.php file contains a bit that starts like this:

    <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
    <html xmlns=”http://www.w3.org/1999/xhtml”>
    <head profile=”http://gmpg.org/xfn/11″>

    If your doesn’t, maybe the headers are written someplace else!

  18. Will (6 comments.) on September 14th, 2007 1:21 pm

    Thanks! Very strange. Have you ever heard of this? I am not real advanced in this stuff, but I found the bit you described above in my index php file. I put the code in that file and it seems to work great. Make sense to you??

    -Will

  19. Lucia on September 14th, 2007 1:44 pm

    Will, if it’s the index.php in the Wordpress directory, it will work there. Just remember to add it again whenever you upgrade!

  20. Will (6 comments.) on September 15th, 2007 9:41 am

    Actually it is in the index php file in my theme’s files and directory. I have never touched the index php file in the WordPress directory. What is that file for?

  21. Will (6 comments.) on September 15th, 2007 9:43 am

    I see now that the file in the WP directory only instructs WP to use the one in the theme directory.

    Thanks again for this!

  22. Lucia on September 15th, 2007 10:30 am

    Yep! It’s best not to touch the index.php file in the main WP directory! It does very little, but you can screw things up. Your index.php file must load stuff in an unconventional order. (But that’s ok. :) )

  23. S Peterson (6 comments.) on September 30th, 2007 6:58 pm

    I think this is tongue-in-cheek, but I don’t know enough to be sure. I placed the code first in my theme’s Main Template, index.php. When I reread your instructions, and you said “header” I placed a copy of your code in the header.php file of my theme. So far the blog is running fine.
    The question is, Is this duplicate content? ;->

  24. S Peterson (6 comments.) on October 2nd, 2007 12:15 pm

    My theme template got destroyed; in rebuilding the look and feel, I concentrated first on what the end-user would see. Blog statistics went way down. I was just getting used to having lost many people, and having lost those that the search engines had sent, when I worked behind the scenes and reinstalled this plugin.

    Overnight!! Search engine traffic for three–Google, MSN, and AOL–increased 200% each, a couple of 100% search engine increases (from 1 to 2, but still. . .). After I installed the plugin, visits soared 243% the next day, almost to the pre-breakdown high!

    I’m sold. Keep this stuff coming.

  25. Lucia on October 2nd, 2007 12:17 pm

    Wow! That’s amazing.

  26. Eliminate Duplicate Content: Canonical URL Fixer Plugin. : Big Bucks Blogger on October 8th, 2007 11:40 am

    […] I wrote that about a month ago? Maybe you wanted to fix the problem, but you didn’t like adding a hunk of code to your header? […]

  27. John007(new comment) on May 16th, 2008 3:19 am

    Thanks for the awesome code, it’s really work for WordPress. Anyway, I tried it with Joomla but it’s not workable. Do you have any idea for optimizing this code ? I need your kind help.

    Many Thanks.

Leave a Reply




Optimize Wordpress for Search: No more sercret duplicate content! was posted on September 4, 2007 - Filed Under Google Monetize WordPress |  

 
  • Blog Rush

  • The footer loaded. :)