Advanced WordPress SEO Optimization

Status
Not open for further replies.
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).

After reading it I am a bit lost.. I am gonna explain why. So I understand that we have to keep up with two rule:

1. ONLY ONE h1 per ANY page
2. We should not skip levels (for example, from H1 to H3).

Ok, so my concept is that my homepage (www.mydomain.com) has h1 with a description of my website placed in <title></title> and h2 as a names of the posts which are listed below (around 5). That was easy.

But what if I go to one of the post (e.g. www.mydomain.com/hello-world) and again I have to keep up with BOTH rules so title of the page is same as in HOMEPAGE but has tag h2 instead of h1 and title of the post has h1 to give him importance??

So it will look like:

<h2>page description</h2> - eg. "Best Cars and News from Industry"

<h1>single post title</h1> - eg. "Citroen GT: Game car arrived!"

But..it broke rule No2 to keep higher tags h higher on website and then going down (as search engine would like to see).
 
@ItsHere

So on homepage you have H1 with whatever keywords your site is targeting and H2 as the post titles. OK!

On post pages, you should have H1 as the post title. You should not have smething as on homepage because this is a post page not the homepage. This page targets its own specific keywords not the ones of homepage.

So on post pages you would have for example for x.com/my-cool-post you would have:

<h1>My Cool Post</h1>

Now, any H2, H3, etc you would have would be in the actual post text.

In order to achieve this you need to either make template files for each type of page (e.g. you'd have home.php for homepage and single.php for a post) or you use WP conditional tags to decide how you structure. For example something along the lines below (haven't tested it but the idea is good):

Code:
<?php

if(is_home() || is_front_page()) {
  // page is homepage
  echo '<h1>'. get_bloginfo('description') .'</h1>';
} elseif(is_single() || is_page()) {
  // page is either a post or a page, we use the post title. Obviously this whole if..else code has to be in THE WP LOOP to work.
  ?><h1><?php the_title(); ?></h1><?php 
} else {
  // it is some other type of page

}

That code wouldn't work well as it is but I'm only trying to give you the idea not to go in detail how it is done because that depends from theme to theme.

Personally I always build my money site themes from scratch and the aproach i take is to make differet files for different types of pages (one for single posts, one for pages, one for categories, etc). Not only i do that but i also use different design, layout and sidebar contents based on what type of page it is.
 
Does anyone have some good SEO themes to start out with editing?
 
The main problem is how to links to the home page from inner pages.

You have to make header clckable, you need a home button, and you want your main keywords as anchor text to the index page.

The problem is that google consider only one link from a page to a page. And this is the first link it finds, but not always.

Usually if you make header clickable then you have to add your main keyword as anchor text. You can do it with css.

Code:
<a href ="/" class="header">Main Keyword</a>

and then assign to the header whatever you want - backgroung image, text with any formatting you want.

This works if you are sure google will count it as the link to the index page. I have read this is not always the case, because the header link sometimes is recognized as part of your code, and google wants intext links.
 
The easier way is to have "keyword" instead of "home" or put link to home usign the keyword from the footer and make all other links to home n0f0llow. Works great!

The main problem is how to links to the home page from inner pages.

You have to make header clckable, you need a home button, and you want your main keywords as anchor text to the index page.

The problem is that google consider only one link from a page to a page. And this is the first link it finds, but not always.

Usually if you make header clickable then you have to add your main keyword as anchor text. You can do it with css.

Code:
<a href ="/" class="header">Main Keyword</a>
and then assign to the header whatever you want - backgroung image, text with any formatting you want.

This works if you are sure google will count it as the link to the index page. I have read this is not always the case, because the header link sometimes is recognized as part of your code, and google wants intext links.
 
@ItsHere

So on homepage you have H1 with whatever keywords your site is targeting and H2 as the post titles. OK!

On post pages, you should have H1 as the post title. You should not have smething as on homepage because this is a post page not the homepage. This page targets its own specific keywords not the ones of homepage.

So on post pages you would have for example for x.com/my-cool-post you would have:

<h1>My Cool Post</h1>

Now, any H2, H3, etc you would have would be in the actual post text.

In order to achieve this you need to either make template files for each type of page (e.g. you'd have home.php for homepage and single.php for a post) or you use WP conditional tags to decide how you structure. For example something along the lines below (haven't tested it but the idea is good):

Code:
<?php

if(is_home() || is_front_page()) {
  // page is homepage
  echo '<h1>'. get_bloginfo('description') .'</h1>';
} elseif(is_single() || is_page()) {
  // page is either a post or a page, we use the post title. Obviously this whole if..else code has to be in THE WP LOOP to work.
  ?><h1><?php the_title(); ?></h1><?php 
} else {
  // it is some other type of page

}

That code wouldn't work well as it is but I'm only trying to give you the idea not to go in detail how it is done because that depends from theme to theme.

Personally I always build my money site themes from scratch and the aproach i take is to make differet files for different types of pages (one for single posts, one for pages, one for categories, etc). Not only i do that but i also use different design, layout and sidebar contents based on what type of page it is.

Actually I didnt managed it yet as I have problems with my Yoast SEO plugin + stuff which I have in header. I have to sort it out and make sure stuff I put in h1 tags (lets say site description) will be not blocked by setting from Yoast SEO plugin...
I am sitting on it a few hours already. I send the ticket to author of this theme but he didn't help me at all. He told me that that could work lol:

PHP:
1.
<?php if ( is_home() ) { ?>
            <h1>your logo</h1>
                <?php } else { ?>
                   <h2>your logo</h2>
<?php } ?>

I tried that and I had text visible above my logo in header.

I will try to find the way to implement it correctly.
 
@ItsHere You have to also adapt the CSS file otherwise you end up with visually broken theme.
 
@ItsHere You have to also adapt the CSS file otherwise you end up with visually broken theme.

Oh I see.. so the simple method he told me could be good, with adapted CSS rule?
What about your method? Script is more advanced..
 
@ItsHere Yes the idea begind his method is the same. Now what matters is what/ho you want to do (it). Maybe instead of blindly trying to do this you should learn a bit about WP themes first and about CSS.
 
@ItsHere Yes the idea begind his method is the same. Now what matters is what/ho you want to do (it). Maybe instead of blindly trying to do this you should learn a bit about WP themes first and about CSS.

I got it to work. I need to improve my programming skills as I don't know the commands etc.

I added in header.php:

<div id="site-title">
<?php
if(is_home() || is_front_page()) { ?>
<h1><?php echo bloginfo('name'); ?></h1>
<?php } else { ?>
<p><?php echo bloginfo('name'); ?></p>
<?php } ?>
</div>


And this in style.css:

#site-title { position:absolute; right:0; top:65px; font-size:16px; color:#FFF; }

Explanation for noobs like me who doesn't have skills but are hungry of knowledge:
<div id="site-title"> in the first line is a key to CSS rule in your Stylesheet style.css (name could be different, but basically this is that first site which appear after you open editor in WP).
I named it site-title, but you can name it whatever you want (but remember to change the name in style.css too).
It calling <h1><?php echo bloginfo('name'); ?></h1> (title of your site, yes, same which you can edit in General Settings) and wrapping it in h1 tags ONLY on main/homepage. Any other singe page/post will gets your title <p><?php echo bloginfo('name'); ?></p> wrapped, as you can see in <p></p> which is normal text. I changed from h2 (which was my plan) to p because it will be on the top of my page according to http://www.seo-browser.com - use it to check how search engine see your website.
So if it is on the top, I don't want it to be my h2 tag as lower than this will be name of my post wrapped in h1 tag which has more value for SE. I just wanted to have tags with more power upper than with tags with less power for SE.
So now I have on single pages:

<p>TITLE OF MY WEBSITE</p>

<h1>YO GUYS! CHECK THIS OUT</h2>

Second part of it is make it visible on your website (and visually correct). This is why I added in style.css that one line.

You get it now - #site-title is the stuff from our header.php Leave position as it is (absolute), values: right, top, font-size, color may vary due to your theme and what you like. Of course you can add some extra values to tweak it visually. I left my small and in the corner.
Thats all. This is the text you will see on every page but only one page (thanks to div from your header.php) will has this wrapped in h1 tags.

Its for other users who might find it helpful. But one thing - try if is working with your theme, it all depends on the structure of your WP theme. However, good luck...

Now I just need to find where the hell author of theme hided files responsible for a few more tags (h3 and h4) I spotted through this magic seo browser I mentioned before...

Ok... I am moving to next stage of your post (I really want to adapt most of the things you mentioned).

CDN...
 
Last edited:
Search engine directives / noindex-ing
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.


I tried to use this codes in header.php and it seems that they doesn't work. This is what I used:
- for noindex search-

<?php if(is_search()) { ?>
<meta name="robots" content="noindex, nofollow" />
<?php } ?>


- for noindex author/date archive/category/tags-

<?php
// Do not index author, date archive, category, tag
if( is_author() | is_date() | is_category() | is_tag() ) {
_e('<meta name="robots" content="noindex,follow" />');
} else {
_e('<meta name="robots" content="index,follow" />');
} ?>


P.S. I am not putting them in PHP code which I have here in text editor because black font on black background of this forum makes it invisible, so orange looks more clear.

Could you check those codes? Why they doesn't work? All noindex rules I should put to header.php? If you are able can you pass me the right one? :)
 
<?php
// Do not index author, date archive, category, tag
if( is_author() || is_date() || is_category() || is_tag() ) {
_e('<meta name="robots" content="noindex,follow" />');
} ?>

Note the double pipe for OR, not single pipe. Single pipe is binary OR. So you have "||" instead of "|". Also no need for the "else" branch.

Put it in header.php inside the <head>...</head> section. Also all should be "follow". None should be "nofollow".

First block (with is_search()) should work as it is.

Make sure you have any caching plugin disabled while you work on this.

Also what you mean it doesn't work? The <meta> tag doesn't get outputted in the source of the page?
 
Seems like I dont have a <head> tag??
On another website I have this <head profile="http://gmpg.org/xfn/11"> on this website I have <link rel="profile" href="http://gmpg.org/xfn/11" /> Is it my <head> tag?? Noob question here -_- This is beginning of my header.php :

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<title><?php wp_title(''); ?></title>



And one basic question - nofollow or noindex saving our link juice and improve SEO??
 
@ItsHere - yeah that's your head tag. The code you pasted has no head lol. Which is bad. Put

HTML:
<head profile="http://gmpg.org/xfn/11">

after the "<html ....>"

and

HTML:
</head>

before "<body".

That PHP code to make noindex the pages you can just put it after/below "</title>".

noindex - SE will not index the page. Useful to mark duplicate pages or any page you dont want indexed.
nofollow - SE will not follow the links on the page. You DO NOT want nofollow. So either use "noindex" or "noindex,follow" for the meta robots value.
 
After I read this, I quickly implemented all of the suggested changes! Very valuable tutorial! I hadn't noticed these things...lol..;
 
Thank you for fast message!

@ItsHere - yeah that's your head tag. The code you pasted has no head lol. Which is bad. Put

However thats strange because in source code of the page I saw meta descriptions and titles and also seo browser (online scanner) was able to read my header with all content.

I think that
<link rel="profile" href="http://gmpg.org/xfn/11" />

it same as your recommended

<head profile="http://gmpg.org/xfn/11">

However I changed for yours...
That PHP code is right after <title></title> tags.
Ok, now testing... how can I check now that my tags and others I made noindex are really noindex? Any online scanners?
 
you check by looking in the page source in the browser. if you have the meta robots you're ok.

<link is one thing, <head is another thing. any page has to have <head for correct/valid structure.
 
Beginning of my source code looks like that (I cut off all stuff from inside of < > ):

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
<head profile="http://gmpg.org/xfn/11">
<title>......</title>
<meta name="description" content="....." />
<meta name="keywords" content="......." />

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />


I hope thats some of the meta you mentioned ;)

Well, I am adding noindex after I added all the tags I have on my site. When duplicates drop down? May I speed it up by adding task for crawler in my Google Webmaster Tools?

One more thing: I skanned my website few minutes ago by seo plugin for Firefox - SEO QUAKE - to see keywords density on my site. Is it normal that basically he grabbed from my website all words (doesn't matter they are links, writings, h1, titles or others) and made the map of density of all words. So sad that on total number of words, instead of having highest numbers from repeats of main keywords it showing me words like name of the author (due to post made and credited to him) or number 2012 due to current year..
 
Last edited:
Great topic here!

What do you think about this example above:
Code:
<h1>title post/page</h1>
text here
<h3>topic</h3>
more text here
I must use h1, h2 and h3.. Or i can use h1 for title and next use h3?

Other question.. In homepage/blog page, do you use any h tag? And in sidebar, on widget titles?

Thanks in advance!
 
Great topic here!

What do you think about this example above:
Code:
<h1>title post/page</h1>
text here
<h3>topic</h3>
more text here
I must use h1, h2 and h3.. Or i can use h1 for title and next use h3?

Other question.. In homepage/blog page, do you use any h tag? And in sidebar, on widget titles?

Thanks in advance!

Its better if you use h1 then h2 then h3 tags. Try to avoid skipping e.g. h1 -> h3, h2 -> h5.

In homepage (my main page) I have h1 for title and h2 for recent post, so there is only one h1 and many h2.
 
Status
Not open for further replies.
Back
Top