1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Advanced WordPress SEO Optimization

Discussion in 'White Hat SEO' started by madoctopus, Dec 8, 2011.

Thread Status:
Not open for further replies.
  1. madoctopus

    madoctopus Supreme Member

    Joined:
    Apr 4, 2010
    Messages:
    1,249
    Likes Received:
    3,498
    Occupation:
    Full time IM
    A user here PM me about helping him with on-site WordPress theme optimization for SEO. A comprehensive guide for this would probably end up tens of pages long, but I am going to outline here at a very high level what you have to do.

    If you have no experience with web development you will not be able to implement most of these optimizations. You are required to at least understand HTML but PHP knowledge is very useful as well (otherwise you will screw up your themes trying to do this or not obtain the results you intended).


    There are two aspects to on-site SEO optimization for any site (whether it is a WordPRess, Drupal, Joomla or static web pages):

    1. SEO optimized URLs (permalinks)
    2. HTML semantic structure
    3. Search engine directives / noindex-ing
    4. Internal linking architecture


    SEO Optimized URLs (permalinks)
    Go to WordPress admin at Settings>Permalinks. Ideally you would have just %postname% for 'custom structure' but depending on how you setup your blog that might produce performance problems or not work as expected (conflicts with page URLs). Just make sure you have it in the permalink, even if you have other things like date tags (%year%, %monthnum%, %day%) or %post_id%. You don't loose much if %postname% is not alone.


    For category permalinks I personally always use a category base removal plugin (adapted by myself). That is so you have http://domain.com/catname instead of http://domain.com/category/catname. The change I have made to the existing plugin was to also remove parent categories from the category URL (because I have verbose/deep structure for categories and the URL would become long and not as relevant for the keyword). What I mean is, instead of http://domain.com/catname/subcat1/subcat2 I just have http://domain.com/subcat2.


    The plugin you can use for this is WP No Category Base.



    I will not share the change I have made because it is done in a hackish way and only works well with the specific setup I have. Sometimes I have to adapt it if I change the architecture of links for a site. If you know PHP basically you just have to explode() by "/" the URL before returning it (in the plugin code) and keep just the last segment (the last/actual subcategory permalink).



    HTML Semantic Structure

    This is where WordPress is shit! 99% of the themes (or more) are complete crap in this area. Even themes that are advertized as SEO-optimized are crap in this area (maybe not 100% crap but more than 50% crap - by 'crap' I mean done the wrong way and not optimized).

    H1-H6 tags have semantic meaning - they represent titles/subtitles - have more weight for a search engine (H1 most weight, H6 least weight). Usually you use them as subtitles within a post but a lot of themes (99% of them) use H1-H6 tags in other places, mainly the sidebars (as titles for widgets/panels). Also many themes use H1 tag for the blog name/logo in the header. This is bad on-site SEO.

    Why is it bad to use H tags for widget/panel titles (in sidebars)?
    Because they appear on every page and pollute your keyword relevance with generic words like "Categories", "Tags", "Archives", "Latest posts". Google may actually have exceptions in their algorithm to take this into consideration during the weighting of the content but you can't rely on that assumption. That means on a post page where you have a H2 subtitle in the post "Loosing weight is not difficult!" you also have for example 4 panels with H2 as "Categories", "Tags", etc. So you end up with diluted relevance for "loosing weight".

    Why is it bad to have the site name/logo as H1?
    Because it appears on EVERY page of your site. Hence you either end up having two different H1 tags (one for logo and one for the post title) - which is semantically incorrect (you should have only one H1 per page and you can have multiple H2-H6) or you have the blog name/logo as H1 and actual post title as H2 (lower weight). You only try (maybe) to rank for your blog name with the homepage so having it marked for search engines as being relevant on inner pages (post, category, tag) is bad practice because it dilutes the weight of the keyword that page was targeting.

    Tags with and without semantic meaning
    DIV and SPAN are HTML tags that have no semantic meaning and have no extra weight/relevance for SE, so use them if you don't want to give extra weight to the text/content in them. These tags are used by web developers as containers. Difference between DIV and SPAN is that DIV is block-level and SPAN is inline-level (has to do with rendering and CSS). What that means is some content put inside SPAN will appear inline with what was before and what is after it (other inline-level elements are B, STRONG, EM, I, DEL, U, IMG, A, etc. - tags that if you put in a paragraph of text will not add a line-break). DIV is block-level so if you put a word inside a DIV tag it will move it to a new line in the rendered page (other block-level tags are H1-H6, P, BLOCKQUOTE, OL, UL, LI, etc).

    So what you should do is edit your theme files so that you make the blog name/logo H1 only for homepage but for any other pages you make it DIV or SPAN (you can use WP conditional tags for this). You could make it DIV/SPAN on all pages and just add a H1 in your homepage with whatever keyword you're targeting.

    Then you have to change those H* tags inside your sidebar. For that you have to edit sidebar.php file in your theme's folder (and possibly functions.php if the theme is more advanced/intricate). You look for H* tags (generally H2 is used) and replace them with DIV. Now you very likely fucked up the theme (how it looks) so you have to go and adapt the CSS rules (in style.css) for those things so they display correctly. I'm not going to go into details - if you know web development a bit you know what I mean, otherwise you're stuck and I can't help you.

    What you basically do is:

    • Make single post and pages have the tite within H1
    • Make listing pages (category, tag, archive, etc) have the listing title as H1 (e.g. <h1>Category Name</h1>) and actual post titles rendered from the loop as H2 (e.g <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>).
    • Have no H1-H6 semantic tags as widget/panel titles in the sidebars or other places on the page that are not the actual content/post. You can have (though really not recommended) H2 tags in the sidebar for example if you have a "Latest posts" listing and H2 would be the post title (not the "Latest posts" widget title).

    One step further but overkill
    If you want to take this optimization to the top, you'd have to make it so the order of the content in the HTML source code is the one you want (because content and links found first are given a bit more importance than links found last). That means you'd have the actual post content first and the sidebar second and the footer and header last, even though you'd use CSS to render them the usual way. This is advanced shit and frankly implementing it on an existing theme is overkill (can be difficult and time consuming). Also I have reasons to believe that Google now uses more advanced algorithms to detect the various sections of a web page and does not rely on the order of the source code anymore.


    Search engine directives / noindex-ing

    Canonical URLs
    First of all, WP already uses canonical URLs so unless you built a custom theme from scratch or have some very peculiar requirements you don't have to do anything about canonical URLs.

    Search results pages
    Unless you're doing some advanced shit and know what you're doing, noindex search results pages. Even Google recommends this. You can use search function on sites with lots of pages to do some advanced optimization (by inflating the number of indexed pages) but I won't go into details now as this has nothing to do with WP optimization.

    Even better replace WP search with Google Site Search as it offers better results to your visitors.

    Tag pages
    One very important thing is to make tag pages noindex. This is easy and there are many ways to do it so I won't explain any of them but just enumerate some: modify header.php theme file, do a hook for wp_head() inside functions.php, use a plugin (e.g. Headspace2 SEO plugin), etc.

    Why would you make the tag pages noindex? Because for most blogs they produce vast amounts of duplicate pages. Ideally you'd have them indexable and you would pay great attention to how and when you use tags so you don't end up with:

    • Tag pages with just 1-2 posts listed on them (only 1-2 posts were tagged with that term)
    • Tag pages that have same posts as other tag pages (e.g. you have 10 posts and you tagged all of them with both 'term1' and 'term2' but you used those terms on nothing else).
    What happens is the number of indexed pages in search engines decreases (obviously) but SE likes your site more. I know cases where noindex-ing tag pages increased traffic by 300% from Google. I'm not saying this is the norm but if you have lots of tags (a lot more tag pages than content pages) and they produce lots of duplicate content pages, that is bad for you. Again, I stress the fact that having tag pages indexable is good and useful but ONLY if you pay a lot of attetion to the type of listing pages they produce. For most people this is a lot of hassle so it is better to just noindex them.

    Category pages
    If you don't use categories as they were intended but more like tags you end up in same problem as described above. Obvioulsy keep category pages indexable but make sure you don't "spam" with tens or hundreds of categories that each have only a few posts in them.

    Archive pages
    You can noindex them in most cases or just make sure you have no archive-type links from sidebar, post date or other places. Unless you have a multi-user blog with lots of users that post lots of content in lots of categories, you end up with archive pages being kinda duplicate content. On top of that they dilute your internal linking anchor relevance (alongside the keywords you're targeting you have anchors like "2001", "December 2011", etc). At most you should have a yearly or monthly (worst case) archive. Under no circumstances should you let google index day archives because unless you have a blog where you make more than 5 posts/day, you end up with lots of tiny, shitty, spammy pages.

    Any other type of archive/listing page (e.g. author) should be noindex, or even better have NO LINKS pointing to it so SE don't know it exists.

    Internal linking architecture

    Better homepage link
    In the header navigation if you have a "home" link, make it n0follow. Add a d0follow link towards the homepage in the footer and instead of "home" use the actual keyword the homepage is targeting. Ideally you would not do this but instead have no "home" labeled link and use the keyword in the header navbar for the home link. However lots of people find it good user experience to have a "home" link in case they get a bit lost or something (in practice many people don't know they can click on the logo to go to homepage).

    Remove polluting links
    I was telling you to noindex tag pages and other types of pages. This is the other side of the coin. Remove completely any links from your site towards such pages you don't want SE to find. You can keep tag links if you think they add to the user experience (but noindex tag pages as I've said previously) but just eliminate archive/date links from the sidebar. Maybe if you have issues with SE finding all your pages, keep an archive page (not panel in sidebar) and link to it with ONE SINGLE link from the footer from the homepage ONLY (not from other pages).

    Also you have to go and modify your theme files so that you don't have the post author and date (everywhere they appear) as links but as regular text (otherise you still end up with SE indexing those unimportant pages).

    Have a good category structure
    What i mean is "silo" type structure. User phpbuilt made a plugin for this, don't forget to say thanks or rep him, he deserves it for saving your time (also go and read through his posts, he has some great ones). You find out what a silo structure is on phpbuilt's post. This is not the perfect structure for any type of site, so use common sense in choosing if to use it or not.

    Frankly, I think a solid category structure and silo-type internal linking is the most overlooked beneficial on-site SEO thing you can do. This is because by using this you can cluster keyword families (organize your site as highly relevant topical hubs around keyword families).

    Remove useless widgets/panels
    Any panel/widget that doesn't improve user experience, the SEO or is redundant in terms of SEO should be eliminated. That means tag cloud (if it wasn't obvious by now tags are evil), archive links, recent posts, latest comments and crap like that. If you want to have archives, you can have them as a dropdown box and it won't affect your SEO.

    If you don't have the latest posts listed on homepage, use a latest posts plugin but just on the homepage or just in one page that gets crawled often (to help with indexing the latest posts you make).


    Plugins I recommend
    I use very few plugins, but some that I recommend are:

    HeadSpace2 (no I do not like All-in-One SEO or the others and I do NOT use this one either because I usually have my own hardcoded SEO so don't need a plugin for this)
    Contact Form 7
    WP No Category Base
    SEO Auto Links & Related Posts (only on certain types of sites, I recommend to do this interlinking manually for important sites)

    I'm not saying they are the best, they're just the ones I have used. I'm not staying very up to date so there might be better ones.

    By the way don't use plugins just because they exist. If you don't see a good reason to use it, if it doesn't improve SEO or user experience, then don't install it. Also lots of SEO plugins are actually bad for SEO (imagine that). You may end up with a very empty sidebar which is again not good, so just use some SEO-insignifiant plugins/panels/whatever to make the page look better (not so thin).

    Plugins can be dangerous. I've seen folks who took control over tens of thousands of sites using WP plugins that they built with trojans/backdoors in them. There is no way for you to know this unless you are good with PHP and can read and understand the plugin code, so just always make sure you install plugins hosted on wordpress.org plugin repository. Chances for a plugin from wordpress.org to be dangerous are smaller.


    That's it so far, I'm sure this was a pain to read for most of you that don't know at least basic web development and never opened a WP theme file. But hey, you can't have both 'easy' and 'advanced' in the same sentence when it comes to WordPress.

    Oh, I almost forgot, for all of those who think WordPress is great for SEO and Google loves WordPress and all that... wait for it... here it goes:

    [​IMG]

    Updates:
    I've made an addition over here read that too.
    I may add more stuff so keep an eye for future posts in the thread (I'm not sure if I can edit this post forever).
     
    • Thanks Thanks x 261
    Last edited: Dec 8, 2011
  2. Mkevitte

    Mkevitte Newbie

    Joined:
    Dec 8, 2011
    Messages:
    17
    Likes Received:
    2
    thank you it help a lot
     
  3. cyberzilla

    cyberzilla Elite Member Premium Member

    Joined:
    Nov 15, 2009
    Messages:
    2,204
    Likes Received:
    3,364
    Location:
    zeta reticuli
    Pretty good solid information about on-site SEO. Appreciate you for taking time to explain everything in detail!
     
  4. call4blood

    call4blood Newbie

    Joined:
    Dec 8, 2011
    Messages:
    3
    Likes Received:
    0
    great article. it will help a lot of guys and perhaps prevents them always asking the same questions
     
  5. t0m3313

    t0m3313 Regular Member

    Joined:
    Sep 11, 2011
    Messages:
    224
    Likes Received:
    56
    Thanks a lot, have just read the first part and already recognized some on page fails on my page :) No it´s time to change some code :biggthump
     
  6. rpkrocks

    rpkrocks Jr. VIP Jr. VIP

    Joined:
    Feb 4, 2010
    Messages:
    920
    Likes Received:
    918
    Location:
    Bḥārata
    Home Page:
    +Rep MadOctoPus Always Loved Your Posts

    XMarked It
     
  7. dan777

    dan777 Junior Member

    Joined:
    Mar 3, 2011
    Messages:
    106
    Likes Received:
    15
    Location:
    Europe
    I was afraid that I don't know a lot - now I know I do not know nothing. :(
     
  8. teflonbrain

    teflonbrain Junior Member

    Joined:
    Jun 27, 2009
    Messages:
    107
    Likes Received:
    27
    Excellent material. Stuff I've always wanted to know but, since I've picked up html and php on my own over the years, didn't really know where to begin. Greatly appreciate it.
     
  9. madoctopus

    madoctopus Supreme Member

    Joined:
    Apr 4, 2010
    Messages:
    1,249
    Likes Received:
    3,498
    Occupation:
    Full time IM
    I just reread the post... my grammar is that of a 5 years old... lol
     
    • Thanks Thanks x 3
  10. takeachance

    takeachance Power Member

    Joined:
    Jul 31, 2009
    Messages:
    557
    Likes Received:
    412
    Location:
    The UK of A
    As always, educucational inspiring stuff - thanks madoctopus. I will be revisiting my tag pages after reading this! rep+ given.
     
  11. madoctopus

    madoctopus Supreme Member

    Joined:
    Apr 4, 2010
    Messages:
    1,249
    Likes Received:
    3,498
    Occupation:
    Full time IM
    A few more things, as I have forgotten to mention them in my original post.

    A very easy way to increase the uniqueness of the listing pages is... can you guess? ... adding unique content to them. Obvious but very few people take the time to do it. I highly recommend you to add descriptions to categories and make sure they are used in the category pages by your theme. If the description does not appear but you know you added it, you have to modify a certain file from your theme. Depending on how the theme is built it may be index.php, category.php, archive.php or some other file. Again coding knowledge is requiredbut you can outsource this for like 5 bucks. You can even make the category description appear below the posts so you don't waste screen real estate(user will just be interested in the listing of posts).

    Descriptions can be anything between 50 to 200 words (maybe even more if you're hardcore and/or makes sense).

    You can also use descriptions for tags and that is a great way to make tag listings more unique and appealing to search engines (if you choose to do it the hard/best way and have them indexable). Don't expect traffic coming to the tag pages, chances for that are small even if you add unique descriptions. However you do get a positive effect for the posts linked to from those tag pages.

    Also you don't even have to do this for all tag pages (though is recommended) but it could help a lot depending of the site you have, the content and the keyword tree (as in computer science organized graph structure).

    For example let's say you have a site about digital cameras. You could use tags for feature names. So you could have tags like:

    • image stabilization
    • image stabilization lens
    • burst mode
    • ISO
    • ISO 100
    • ISO 200
    • ISO 300 ... and so on to ISO 1600 or whatever.
    For each of the features you'd have a description. However as you see some of the tags overlap as keywords. If you use tags that overlap so much and you do it wrong, you end up with google seeing your site as spammy. If you do it right you get shitloads of traffic. The wrong way to do it is explained in my original post (tag pages with very few posts or identical/similar posts in the list). Done right means having a great description. What is a great description for a tag?


    Tag name: ISO 100
    Tag description: ISO 100 is one of the lower <a href="/tag/iso">ISO<a> settings available on a digital camera. Using this setting you obtain picture with a very low noise. While it is best to use ISO 100, and generally low ISO numbers, if the amount of light is low then you will need to use higher settings like <a href="/tag/iso400">ISO 400</a>, <a href="/tag/iso600">ISO 600</a> or even the very noisy <a href="/tag/iso1600">ISO 1600</a>. For a complete understanding on how ISO settings should be used to make amazing pictures you can go and read our in-depth guide <a href="post/iso-guide">Using ISO Settings on Your Digital Camera</a>.



    As you see I am linking from the tag description to other tag pages and even a post page (WOA! did you knew you can use HTML code in the description fields for tags and categories?). In this example I am overdoing it a bit as I am using so many links in such a short description for a tag. But it's still OK I don't think SE mind it since it is highly relevant. As you see it is also very useful for somebody who doesn't know much about photography.


    On the other tag pages for ISO 200, ISO 400, etc you would have different descriptions and link to eachother in a relevant manner. For "image stabilization" you could explain it as being the technique while for "image stabilization lens" you would focus it around lenses with this feature.


    We only fixed the problem partially - unique descriptions. What about the problem of having two or more tag pages listing the same posts? This is the sneaky part of using overlapping keywords :) Bet you didn't saw this coming. If you make 10 posts and you would tag them all with "image stabilization", instead tag 7 of them with "image stabilization" and other 7 with "image stabilization lens". You have 7 posts listed per tag page but only 4 of them are the same. You could obviously split it 5/5 and have it 100% unique. Now you have two tag pages with pretty much unique content. That's enough to be important for a SE and not be seen as duplicate, especially that you have a unique paragraph for the tag description (actual post excerpt is duplicated on many post listing pages).


    Which takes me to another phenomenally important thing (how could I forget this in my original post?! :dunno:):



    ALWAYS USE SHORT EXCERPTS ON LISTING PAGES!


    By default you have that more tag to delimit how much of the post you want to appear in the listings. You also have the excerpt field. Each theme is built differently. some use the excerpt, some use the more tag, some autodetect. The idea is you want the fragments of text from the actual posts that appear in listings to be short (max 200 words, ideally around 70-100 words). If you leave the full post content on the listing pages you've just fucked yourself up completely in terms of on-site SEO (well, maybe not completely because Google knows WP/sites/developers sucks ass and adapts to this partially).



    I have the sensation that there was more stuff I wanted to tell you about... guess I'll come back if I remember what it was (no I don't smoke weed).
     
    • Thanks Thanks x 21
  12. takeachance

    takeachance Power Member

    Joined:
    Jul 31, 2009
    Messages:
    557
    Likes Received:
    412
    Location:
    The UK of A
    Err, no I didn't actually! I shit you not, thats some really useful stuff for anyone running WP and lets face it, thats most of us right? :)
     
  13. blackcontent

    blackcontent Newbie

    Joined:
    Sep 5, 2011
    Messages:
    43
    Likes Received:
    3
    Thanks for the detailed responses to my PM. :)

    For a little background FYI, and to add unnecessary support to some of what madoctopus says here:

    After analyzing the code from about 20 different Wordpress themes based upon common on-page SEO recommendations, I was baffled that basically every fucking guru says Google busts a nut at the thought of Wordpress. And then I was ready to give up on Wordpress entirely after editing key php configuration files for the various Wordpress themes in order to implement on-page SEO recommendations and finding their arrived at look was fucked up just as madoctopus mentioned.

    I had come to the conclusion that the gurus were full of shit when it comes to Wordpress SEO value and jumping ship to Joomla was the way to go. A search on this forum hoping for confirmation led me to a post by madoctopus.

    So anyways, thanks again for the informative posts.
     
  14. paulcarter97

    paulcarter97 Regular Member

    Joined:
    Nov 27, 2011
    Messages:
    392
    Likes Received:
    37
    Very informative guide about the on page SEO. Usually most people just focus on Off Page SEO like spamming backlinks, etc while forget about the on page SEO. Although this tutorial is useless if we just read it without taking any actions.
     
    • Thanks Thanks x 1
  15. LongBanana

    LongBanana Regular Member

    Joined:
    Oct 23, 2009
    Messages:
    411
    Likes Received:
    247
    Location:
    Chicago, IL
    Very nice and detailed guide. Thanks + rep given.
    A lot of people don't really take into consideration the importance of on-page SEO, but it can help boost your rankings quite a bit.
     
  16. Russ1395

    Russ1395 Jr. VIP Jr. VIP Premium Member

    Joined:
    Sep 16, 2010
    Messages:
    128
    Likes Received:
    108
    Home Page:
    Thanks, but what does Contact Form 7 do for SEO?
     
  17. madoctopus

    madoctopus Supreme Member

    Joined:
    Apr 4, 2010
    Messages:
    1,249
    Likes Received:
    3,498
    Occupation:
    Full time IM
    Nothing for SEO but is useful so people can contact you.
     
    • Thanks Thanks x 1
  18. dan777

    dan777 Junior Member

    Joined:
    Mar 3, 2011
    Messages:
    106
    Likes Received:
    15
    Location:
    Europe
    Already SEO optimized WP theme - does it exist?
    Which one?
     
  19. cristianraiber

    cristianraiber Regular Member

    Joined:
    Nov 22, 2008
    Messages:
    293
    Likes Received:
    381
    Occupation:
    Onliner
    Location:
    Internet
    Just a quick tip - if you're not keen on adding tags to your pages and don't want to deal with the setting up of tag pages - as madoctopus described above - but still want those keywords on the page try writing up some bogus comments with your keywords in them and getting them approved (of course, by you - you're the admin, remember ? :) )
     
  20. madoctopus

    madoctopus Supreme Member

    Joined:
    Apr 4, 2010
    Messages:
    1,249
    Likes Received:
    3,498
    Occupation:
    Full time IM
    There are several that are more or less optimized but haven't found any to be 100% as per my requirements. That is why personally I always mess with the code a bit.

    That being said as I made it clear in the previous posts it is not only about the HTML structure but also about how you build/manage the content on the site. Even with a 100% SEO optimized theme you only cover a part of the on-site SEO, you still have to take care of the content and internal linking and do it in a way that gives you the highest positive effect.
     
    • Thanks Thanks x 1
Thread Status:
Not open for further replies.