Archive for the ‘Yoast’ Category
Yoast: The heading structure for your blog
The heading structure of your pages is one of the very important aspects of on-page SEO. It defines which parts of your content are important, and how they’re interconnected. Because they have different goals, a single post needs another heading structure than your blog’s homepage or your category archives. This post intends to give you the basic pointers to get your heading structure right for those three different cases.
If you’ve ever heard of this new kid on the block called HTML5, or maybe even consider yourself an expert on it, please note that this post still treats headings in the HTML4 / XHTML1 way of using headings. I’ll briefly talk about headings in HTML5 in the end, it’s a whole ‘nother ball game!
This post will cover:
- 5 basic principles about headings
- The headings for your homepage
- Heading structure for your single posts / single pages
- Structure of headings for your category / tag / taxonomy pages
- Headings and HTML5
- Conclusion: re-think your blog’s headers
5 basic principles about headings
Let’s get these things straight before we do anything about our heading structure:
- The most important heading on the page should be the H1.
- There is usually only one H1 on any page.
- Sub-headings should be H2′s, sub-sub-headings should be H3′s, etc.
- Each heading should contain valuable keywords, if not, it’s a wasted heading.
- In longer pieces of content, a heading is what helps a reader skip to the parts that they find interesting.
Based on headings, there are tools out there that can, and will, make an outline for your content. If you were to make an outline for this article, it would look like this:
- [h1] The heading structure for your blog
- [h2] 5 basic principles about headings
- [h2] The headings for your homepage
- [h3] The issue of full posts on archive pages
- [h2] Heading structure for your single posts / single pages
- [h2] Structure of headings for your category / tag / taxonomy pages
- [h2] Headings and HTML5
- [h2] Conclusion: re-think your blog’s headers
The most widely known, and probably also the easiest, tool capable of doing this is the W3 Validator.
The headings for your homepage
So while we can (and will) discuss some specifics in the comments, your homepage should probably have a structure that looks like this:
- H1: Blog’s name
- H2: Your blog’s tagline, if it’s “keyword-rich”; if not, all your recent posts should have an H2.
- H3: Your recent posts, or, if those have an H2, this could be used for somewhat older posts.
- H4: related content in the sidebar, like the heading of an “about” widget.
- H5: Unrelated headings in your sidebar, footer, etc.
As you can see, I differentiate between “related” widgets and unrelated widgets. It’s no use at all to have an H3 heading saying “Our Sponsors”. An H4 heading saying “About this SEO blog” could be useful though, if “SEO blog” is what you want to rank for.
The issue of full posts on archive pages
Maybe you’ve seen it, maybe you didn’t yet, but this sort of heading structure creates a problem. If you’re displaying full posts on your front page, your sub headings would be H2′s, just like your post titles. That’s wrong, of course, and a good example of why we should be separating our content and markup a bit more then we’re doing now, but that’s not an easy fix. Basically, if you’re displaying a post on an archive, category, tag or home page, each H2 should become an H3, H3 should become H4, etc.
No code samples yet, but my mind is working on this now, so it might come soon.
Heading structure for your single posts / single pages
This one is simple:
- H1: post / page title
- H2′s and H3′s: subheadings and sub-subheadings
- H4: your blog’s name, and possibly related widgets
- H5: same as above: sidebars etc.
Makes sense right? The most important line on the page is the post or page title, second come the subheadings. Your blog title still has some value because, if the post is good, people will search later on for “Yoast WordPress SEO”, for instance.
Structure of headings for your category / tag / taxonomy pages
If you actually want your category and tag pages to rank, meaning you’ve given them some unique content and are making them interesting for people, the heading structure should basically be the same as the homepage, with this difference:
- H1: category / tag title
- H2′s: post titles
- H3: blog’s name
- Rest: repeat from homepage.
Headings and HTML5
In HTML5 the entire method of dealing with headings changes, and while it’s a bit harder to grasp for people at first, the new system makes a lot more sense for content management systems. In short: headings and heading structures are section specific there, where section could be any part of a page. It would take too long to explain here, but if you’re interested, read the header section of Mark Pilgrims excellent Dive into html5.
Truth be told, Mark doesn’t talk about how search engines deal with HTML5 headers yet. In all honesty: I couldn’t tell you yet. Simply a case of “not enough data to tell”.
Conclusion: re-think your blog’s headers
Now it’s time for you to take some action. Go and use the W3 Validator now to check your blog’s outline. If you’ve read an understood all the above, you should now be able to determine whether your theme is doing a good job. If you’re using a premium theme or a theme that you downloaded from WordPress.org, I’d love for you to share your results in the comments!
The heading structure for your blog is a post from Joost de Valk‘s Yoast – Tweaking Websites.A good WordPress blog needs good hosting, you don’t want your blog to be slow, or, even worse, down, do you? Check out my thoughts on WordPress hosting!
Yoast: Quick tip: paths and URLs in WordPress
I was reading an article on Sitepoint about custom write panels the other day when I got heavily annoyed. The direct reason for this was one of their code examples and the authors apparent incomplete knowledge of the WordPress API’s most basic functions and constants. In that example, he does the following:
define( 'MY_WORDPRESS_FOLDER', $_SERVER['DOCUMENT_ROOT'] ); define( 'MY_THEME_FOLDER', str_replace("",'/',dirname(__FILE__)) ); define( 'MY_THEME_PATH', '/' . substr( MY_THEME_FOLDER, stripos(MY_THEME_FOLDER,'wp-content') ) );
That annoyed me, quite a bit. Why? Well because if people write articles about stuff like custom write panels, I expect them to know a bit about the basics of the WordPress API. And well, the WordPress API has constants and functions for these things. So let me introduce you to them in the same order as the author of the articles did his defines above:
ABSPATH constant
Not only is their method inconvenient, it’s wrong for a lot of installs. You see, some people install WordPress in a subdirectory, and depending on what you need, there are two different paths you might need. ABSPATH is a constant that always returns the home of WordPress. So if WordPress is in the wp/ subdirectory, it would give you something like: /home/username/public_html/wp/. If WordPress were installed in the root, it would just return /home/username/public_html/. Now I don’t know how they’re using it, as it’s not used in this particular article, but they’d have to be very cautious with that.
TEMPLATEPATH constant
The second two things they’re doing are possibly even weirder. First they define a constant MY_THEME_FOLDER, which is basically the path to the current theme. WordPress has a very convenient constant for that: TEMPLATEPATH. Since they’re using it in an include, that’s probably what they need. Would save about 4 lines of code. Note that what they call a “folder” is actually a path.
get_template_directory_uri()
This is were they really go wrong. You see, they define a constant MY_THEME_PATH, and then use it as a URL in a call to wp_enqueue_style(), in other words: to enqueue a style sheet. Now paths and URLs are different animals altogether, and they don’t mix well. Take this example:
- My blog is installed in a subdirectory
/wp/ - Because of that
MY_THEME_FOLDERhas been defined as follows:/home/user/public_html/wp/wp-content/themes/example-theme
- The code that sets
MY_THEME_PATHturns that into:/wp-content/themes/example-theme
- The stylesheet is now included with the following path:
/wp-content/themes/example-theme/custom/book_panel.css
- This causes a 404 (file not found error) because that directory simply doesn’t exist! It should have been:
/wp/wp-content/themes/example-theme/custom/book_panel.css
The proper way of doing the enqueue would thus have been the following:
wp_enqueue_style( 'my_meta_css', get_template_directory_uri(). '/custom/book_panel.css' );
Conclusion
I hope you understand why this annoys me. This is exactly the kind of coding that gives WordPress coders out there a bad name, as 5 – 10% of people out there trying this will not get it to work. If you want to prevent from making such mistakes, there’s plenty of resources to learn about these things, or look them up. Two starting points would be the codex and my own cross reference of the WordPress source along with its very convenient WordPress source search function.
Quick tip: paths and URLs in WordPress is a post from Joost de Valk‘s Yoast – Tweaking Websites.A good WordPress blog needs good hosting, you don’t want your blog to be slow, or, even worse, down, do you? Check out my thoughts on WordPress hosting!
WordPress Podcast: Listen to Liz Strauss: “Treat Your Blog Like a Business!”
Liz Strauss gave a masterclass tonight; at least, that’s how it felt to both Frederick and myself. We talked about communicating with your audience, and Liz shared some experiences about open comment nights. We discussed positioning yourself and your blog, and how important personal branding can be.
She told us about feedback loops, and how to use them to listen to your users / clients / audience. She tought us to build our network before we need it, and why and how you should be treating your blog like a business, even if it’s just a hobby. Aren’t you curious yet? Start listening then. You’ll be a wiser man or woman for it at the end of this.
Yoast: 7 reasons for malfunctioning plugins (and their fixes)
It happens to every plugin author: you receive emails from people that your plugin isn’t working. There are about 7 reasons that – for me – seem to be the root cause of up to 95% of these emails, and I thought I’d write them down and show you how I try to handle them.
1. Missing hooks
It annoys the *peep* out of me when I find out that my plugin is in fact working fine, but the *peep* theme author didn’t think it necessary to add a wp_head or wp_footer call. This happens more than you’d think, but in most cases you can’t really blame the user in question, the theme author is just a moron. For your reference: the wp_head() call needs to exist right before the closing call, and the wp_footer() call should be right before the closing tag.
I used to check for this in my plugin, but the code doing the check caused even more problems, so if you have a good solution for this, that’d be appreciated. I personally think WordPress shouldn’t even activate themes without these two hooks.
2. A caching plugin
If you’re looking at a cached version of a page, and you’ve just installed or reconfigured the plugin, chances are the changes aren’t reflected in the output yet. In my Google Analytics plugin, I’ve actually added cache clearing code for W3 Total Cache and WP Super Cache, if you’re a plugin author you might find it useful:
<?php if ( function_exists('w3tc_pgcache_flush') ) { w3tc_pgcache_flush(); } else if ( function_exists('wp_cache_clear_cache') ) { wp_cache_clear_cache(); } ?>
This is only necessary to do after you’ve saved settings that would change the output of your plugin of course.
3. You’re not supposed to see anything
My Google Analytics plugin has the option to hide the tracking code for certain user levels. Turns out that, when you enable this feature, you’re actually not seeing anything at all in the code. That’s a good thing, right? Wrong. It meant dozens of emails coming to me in the course of like 6 months, until I was smart enough to add the following message to the output of my plugin for those users:
echo "<!-- Google Analytics tracking code not shown because users over level ".$options["ignore_userlevel"]." are ignored -->n";
Remember that when people use W3 Total Cache’s minification feature, they won’t even see this. The solution is to wrap it in CDATA tags.
4. You have to actually enable the plugin!
Seems obvious right? Well it doesn’t always seem to be. I get this email about once every 2 months “your plugin doesn’t work, it’s shit. Help me fix it” (sometimes they’re nicer, oftentimes they’re worse
). The best part is when it’s followed, like 5 hours later, by “ehm I actually forgot to activate your plugin”. Happens to all of us, you know.
5. You haven’t configured the plugin yet
There’s a reason my plugins now scream at you to configure them as soon as they’re activated: I got emails saying it didn’t work, when the person emailing simply hadn’t even configured the plugin yet. Yeah I know, my plugin should be able to just guess what your analytics account is, I’d love to be able to, but alas… So, especially for those people who think I have magic skills, there’s now a warning in the admin:
And a notice in the source output:
echo "";
6. You can’t change the settings
Either you’re blind or another plugin is malfunctioning, but you can’t find the settings page for the plugin you want to configure. Luckily, WordPress has you covered (and yes, some people think that emailing the plugin author is the solution for that). Go to the plugins page, and click on the Settings link for the plugin:
That is of course, if the particular plugin actually was kind enough to include that link… For some reason, some plugin authors seem to think these standards don’t have to be adhered to. They deserve to get more email.
7. The plugin is incomplete
When you uploaded the plugin, you might have missed a file, or two. Or the upload went bust. Or the auto install went bust. It happens. I haven’t had to build in a check for this yet, since my plugins aren’t that big usually, but I noticed this in W3 Total Cache most recent changelog:
Added an additional notification to help users identify incomplete installations upon activation.
That shows you two things: A, Frederick knows what he’s doing and prevents people from emailing him over issues like that, B, it happens more often than you’d guess.
Your experiences
All the code examples above have been added to my plugin after several support requests for that particular issue. They might save you a fair bit of time if you’ve just started developing plugins, so feel free to use them. I know a fairly large portion of my readers dabbles with this stuff themselves, I’d love for you to share your experiences in the comments!
7 reasons for malfunctioning plugins (and their fixes) is a post from Joost de Valk‘s Yoast – Tweaking Websites.A good WordPress blog needs good hosting, you don’t want your blog to be slow, or, even worse, down, do you? Check out my thoughts on WordPress hosting!
Yoast: A reader story: One Project Closer
I got an email from Fred of One Project Closer this weekend, outlining how he had handled improving the load time of his blog, and I was so happy with it that I asked whether I could post it online, to which he graciously agreed. So you can now read it in full:
Joost,
I wanted to pass along a HUGE thank you for pointing me in the direction of VPS.Net.
About 2 weeks ago we decided it was time to move off of our Dreamhost shared hosting. I had remembered visiting your site several months back and seeing your note in the sidebar for a fast WordPress hosting solution. When we decided to move 2 weeks ago, I sought out your site again.
In a matter of two weeks we have:
1) switched to VPS.Net
2) optimized with Litespeed
3) installed W3 Total Cache
4) signed up for Akamai and started delivering via CDN.
5) started to optimize our code every way we can.Our home page load times are down to less than 4 seconds from 10-11 seconds on Dreamhost. We saw an INSTANT increase in our affiliate conversions on some pages which will make the VPS.Net solution pay for itself in no time…
I’m now on a mission to optimize the heck out of the rest of our code — moving more to the CDN and figuring out how to keep our rich presentation but streamlining the delivery.
Your site speed is an inspiration. I’m looking forward to figuring out ways to squeeze every last drop of waste out of our loads.
I hope to get to meet you sometime and share our story.
Thanks,
Fred
It’s great to see how people improve their sites just by taking my freely given advice. He’s also very right about affiliate money paying for the somewhat more expensive hosting fees. I’ll tell you this time and again: you get what you pay for… If you’ve got a story like this to tell, please do share it with me! Either through my contact form or through the comments below!
A reader story: One Project Closer is a post from Joost de Valk‘s Yoast – Tweaking Websites.A good WordPress blog needs good hosting, you don’t want your blog to be slow, or, even worse, down, do you? Check out my thoughts on WordPress hosting!
Yoast: Advertise on yoast.com
Let me be honest: I’m asking for your money
There are ad spots free here on yoast.com, and I’d like to fill them. Due to a strange combination of circumstances, I’ve got a couple of ad spots free here at yoast.com at the moment, something I’m not very used to anymore.
Let me first explain why there are so many ad spots free all of a sudden: we ditched two advertisers because they were advertising things I couldn’t agree with. I have no trouble with advertising things I don’t use myself here, they’re not my ads, but I do have an issue with advertising things I’m actively against, so we bumped those out.
A while back, we also ditched some advertisers that were advertising themes that are not GPL. I don’t want to get into a discussion about this, but I prefer advertisements for companies that either do stick to the GPL, or don’t advertise WordPress related things.
Anyway, as you can see, the ad spots are available. There’s no doubt in my mind that BuySellAds will fill them up over time, but I thought I’d help them a bit. You can go here to buy an ad. In case you’re not convinced why you should advertise, see what Ryan Kelly, the CEO of Pear Analytics, one of our current advertisers has to say, who advertise their free site analysis tool:
“Out of the handful of ads we’re running on SEO-related websites, Yoast is converting at a whopping 92% on average, compared to other ads that range in the 20-40% range. It won’t be moving anytime soon.”
So, if you’ve got something you’d like to advertise, go buy that ad and support my effort of spending more time and money on this site.
Advertise on yoast.com is a post from Joost de Valk‘s Yoast – Tweaking Websites.A good WordPress blog needs good hosting, you don’t want your blog to be slow, or, even worse, down, do you? Check out my thoughts on WordPress hosting!
Yoast: Google Analytics for WordPress gets a debug mode
With the wider introduction of the ga_debug.js script (Google Analytics Certified Partners had had access to that for a while so I’d been using it already); I finally had the chance to add a real debug mode to my Google Analytics plugin.
Since the debug script uses the console to display its information, I also added the option to immediately load Firebug lite. See how it works in the following screencast (ow and enjoy my new screencast intro, I’ll be doing loads more screencast in the coming months):
Click here to view the embedded video.
Google Analytics for WordPress gets a debug mode is a post from Joost de Valk‘s Yoast – Tweaking Websites.A good WordPress blog needs good hosting, you don’t want your blog to be slow, or, even worse, down, do you? Check out my thoughts on WordPress hosting!
Yoast: Why functionality in themes is not always good.
So you’ve switched over to a theme that comes with built-in functionality for titles and meta descriptions. Instead of using HeadSpace2, All in one SEO or another SEO plugin, you’re now using the theme’s built-in SEO functions and input boxes for title’s and meta descriptions. It just seems more logical doesn’t it? Loading one plugin less and using the theme’s functionality. It feels like that’s how it should be. I mean, that should be faster, right?
Wrong. Why that’s wrong? Let’s say that, a year from now, you’re tired of this theme and want something else. It happens to all of us. So, you’re switching themes. Have you guessed the problem yet? Because that theme you started using the titles and descriptions of uses it’s own methods and locations for storing those titles and descriptions, when you switch to another theme, it won’t recognize the old stuff.
If you’re smart, you’ll notice. If you’re not, you’ll be in even deeper trouble, as someone I did a site review for recently found out. She’d written superb SEO titles and meta’s for her last 50 odd posts, and the hundreds of posts before that didn’t have them. Took us a while to figure out she’d switched themes…
If you’re a developer, changing a couple of post meta fields in the database might be reasonably easy, but for most people, it’s not. That’s why your theme should only contain functionality that alters the looks and the code of your site, not the content.
So there are no “SEO friendly themes”?
Does this mean a theme couldn’t be SEO friendly? No it doesn’t. A theme still determines a large part of what your heading structure looks like, whether it shows your content first and then your navigation or the other way around, whether your code is clean and tight or all messy etc. etc. etc. These are all very important aspects of on-page SEO, and I applaud every theme developer thinking about this and trying to learn about it.
Conclusion
There’s a reason why we’ve got plugins and themes. We want to separate content from design. If something has to deal with your content, stuff you’d want to be the same regardless of which theme you’re using, it has to be a plugin.
Why functionality in themes is not always good. is a post from Joost de Valk‘s Yoast – Tweaking Websites.A good WordPress blog needs good hosting, you don’t want your blog to be slow, or, even worse, down, do you? Check out my thoughts on WordPress hosting!
WordPress Podcast: First One Blog, Next an Empire
Collis Ta’eed is a veteran blogger and co-founded the Envato network of educational sites and marketplaces covering niches like freelancing and web app’s and much much more. Collis’ network of sites reaches hundreds of thousands of readers monthly, his marketplaces are responsible for enormous amounts of income for developers the world over and his tutorial sites are the hallmark how-to repository for much of the web community.
Collis joined us today to share with us the mechanics of growing initial traffic to your blog, differentiating yourself in the market and monetizing your blog. Listen in to learn more about how to go from freelancer to business owner.
In the news:
- PHP 4 & MySQL 4 reach end of life
- Keep up with upcoming WordCamps in your area
- Matt Mullenweg has released many of his previous themes (with great photo gallery implementations)
Plugin picks of the week:
- Posts 2 Posts – Create relationships between posts of different types.
- Events Calendar Pro – Rapidly create and manage events
- WhyDoWork – Insert AdSense into your blog without modifying templates
- yphplista – An AJAX WordPress plugin for PHPlist integration
Yoast: Link dump: interesting reads from around the web
So last week I’ve started sharing a lot more of what I read on a day to day basis on Twitter, and I decided I had to share these links here on yoast.com as well. Below is a quite extensive list of links that I found interesting, ordered by topic. I’ll try to do these on a weekly basis from now on.
WordPress
-
Code Snippets and Examples
- The only proper way of adding a Facebook “Like” button to your WordPress blog
- An article I wrote recently for Smashing Magazine: Lessons Learned From Maintaining a WordPress Plug-In
- Gravity Forms PayPal integration
- 16 Vital Checks Before Releasing a WordPress Theme
- How to Display Human Readable Post Dates in WordPress
- Control WordPress Content via Userrights or Time
- A good Beginner’s Guide to the Thematic Framework
-
Plugins
- BuddyPress Courseware beta; a very cool plugin for schools & other educational institutions.
- Post to post; nice plugin for creating relations between posts.
- Press This Reloaded; pretty useful if you need to, for instance, adapt the SEO title of a post.
- WPMU.org features my WordPress Salesforce CRM plugin.
- Custom Post Permalinks; I seriously think this should be in WordPress core, but as long as it’s not, this’ll do.
-
News
- Common WordPress Multisite Problems and Solutions
- Top 10 WordPress News Blogs
- When is the Best Time to Post a Blog Post? Not enough people think about this.
SEO
- Without any work from me, my Google Analytics plugin now helps you verify your Google Webmaster Tools account.
- I’m seeing similar stuff to this: Google Webmaster Tools Link data – a case study by Dave Naylor, my favourite UK SEO.
- Want an SEO job? Check out the Daily Mail’s robots.txt file
Analytics
- Qualitative Web Analytics: Heuristic Evaluations Rock! another great post by Avinash Kaushik
- The new Management API for Google Analytics rocks; check out the docs
Web design / web development
- Practical? No. Cool? Yes. Compressing Your JavaScript and CSS to PNG Images
- What a surprise: Steve Jobs was right, Flash fails on Android
- HTML5 for Web Designers: Book Review at Nettuts+ – I’ve read it too, it’s amazing
- Good Help is Hard to Find is another A List Apart classic. Wonder how to apply this to my plugins…
- A very concise explanation of the viewport metatag by David B. Calhoun
- A pretty awesome example of what can be reached with CSS3 now
- I’d almost start using Typekit: Adobe partners with Typekit to bring legendary typefaces to the web.
- MathML is now part of WebKit nightlies, go forth and play, all you math lovers out there!
- Delay loading of print CSS (in WordPress, but useful for everyone)
- Debugging Tools – jQuery for Designers
- This would work perfectly for WordPress plugin developers: Readme Driven Development
Online Marketing / Social media
- Daring Fireball – Online Advertising: Losing the Race to the Bottom – listen to this, seriously.
- What’s this thing called Buzz that Leo talks about?
- Facebook Tabs: What They Are & How to Use Them – Good writeup on RWW
- Quite curious how many people will do this: German Homes Can Now Opt Out Of Google – TechCrunch
Science
- Experts are usually wrong
- Everyone looks better after you’ve tipped back a pint or two, and now we know why
- A nice infographic on the history of the Internet
- Freakonomics: loved the book, looking forward to the movie, check out the trailer.
- Wonder what my wife does? Read her latest paper on the Intergenerational Transmission of Convictions.
Fun
- (Fake) Lady Gaga sings about Java programming with some hilarious quotes
- Gonna have to try this on my son in about 2 years: 4 Tools for Teaching Kids to Code
- Basically, you can’t block Mark Zuckerberg on Facebook, because too many other people did it before you
- You know you’re a geek when you think this is funny
Lifestyle
Mac
- Why Daniel Jalkut is sticking with the Mac
- Precipitate: search for and launch the info you stored in the cloud from Spotlight or G Desktop for Mac
- This is bloody hilarious: No Comment: Justin Long’s jailbroken iPhone
- This proved to be pretty awesome for mp3 splitting: Macsome Audio Splitter
Link dump: interesting reads from around the web is a post from Joost de Valk‘s Yoast – Tweaking Websites.A good WordPress blog needs good hosting, you don’t want your blog to be slow, or, even worse, down, do you? Check out my thoughts on WordPress hosting!

