It’s no secret that WordPress is a popular blogging CMS, but it’s also the framework that many non-blogger websites are built on. For the unfamiliar, WordPress is fundamentally flawed in terms of SEO best practices. Even seasoned WordPress developers will often overlook the obvious. Let’s tweak WordPress a little in an effort to please Google.
WordPress SEO by Yoast
First things first, I strongly suggest you install one SEO plugin, and only one. That plugin should be WordPress SEO by Yoast.
Documentation can be found on the plugin support page, and I’ll go over a few key options below. Yoast SEO allows you full control over everything SEO on your site or blog. It allows you to dynamic or manually set the title and meta description for each page, choose what page types to index and follow, and analyzes your keyword focus on the fly. It’s a great tool and every WordPress developer should have it in their back pocket.
Site Speed Optimization
Google has made it clear that page load time is considered in its page rank algorithm. If you have a slow performing site that is otherwise flawless in SEO terms, decreasing your page load time could improve your page rank by leaps and bounds.
The biggest factor for page load time is the server you are on. If you use a cheap hosting company, or use shared hosting, you might have higher page load times than you would expect. Upgrading to a better hosting company with better servers could cut your page load time in half or more.
If you are on a budget, and you aren’t able to upgrade your hosting, then please consider the WP Super Cache plugin. This plugin generates static HTML files and gives you the option to cut out all the PHP and database queries, and just spit out a static page. It’s very impressive how much this plugin can decrease page load time, without even getting into the advanced settings.
For more information on the WP Super Cache settings, see the plugin page.
Permalink Best Practices
As Nick Herinckx wrote about in his SEOmoz blog post about Advanced WordPress SEO, older versions of WordPress (prior to 3.3) can have significant speed issues if your permalinks do not begin with a number. This means adding
/%year%/ at the beginning of your permalink was extremely important. If you started your permalink with
/%postname%/ then you severely handcuffed WordPress as it queries the database attempting to find the post.
WordPress 3.3 and newer have fixed this speed issue, and you can have whatever permalink structure you want. Still though, some are better than others, and I strongly suggest you choose either of the below:
Note that on Windows servers, your permalinks won’t be as pretty as they will be on Linux servers. While on Linux servers, your URLs will look like http://example.com/post-name/, they will appear as http://example.com/index.php/post-name/ on Windows servers running IIS.
How to Change the Permalink Structure
You’ve probably hear the term Permalink, but for those who haven’t, it’s essentially WordPress jargon for “URL structure.” Out of the box, WordPress uses very unappealing permalink structures. Permalinks will appear as example.com/?p=123. This is an SEO nightmare!
Search engines, and users, would be much more pleased with keywords in the URL structure, like example.com/blog/wordpress-seo. How do we do this in WordPress?
Log into your WordPress admin interface, and go to Settings > Permalinks. You are presented with a few built-in options, but the best option is Post Name.
WordPress will generate a slug version of your post title and use that as the URL string. If your post title is “Web Developers in Minneapolis, MN” the slug will be “web-developers-in-minneapolis-mn”. Because keywords in the URL are a factor in SEO, the slug version is much better than a query string.
If you have an established website and you are using an improper permalink structure, it’s not too late to change it. Unfortunately, if all you do is change the permalink structure, you will have many broken inbound links and a PR nightmare. You will lose page rank because your SEO profile that you’ve spent painstaking hours building up will now be linking to 404 error pages, and not your actual posts or articles.
Say hello to 301 redirects. 301 is the servers way of telling search engines that a page has permanently moved. Search engines pass link credit through 301 redirects. The alternative is the dreaded 302 redirect, which means the page has “temporarily” moved. There are a few easy ways to set up 301 redirects to ensure that your inbound links end up in the correct place, your users don’t get frustrated, and you don’t leak any of your hard-earned SEO gains to 404 pages.
Preferred solution – .htaccess
Working in your .htaccess file directly is definitely the preferred solution here, as you don’t bloat your WordPress installation with another plugin, and you don’t run unnecessary queries on pages that don’t require them.
Thankfully, our friends at Yoast have given us a great tool to generate 301 redirects for our changed permalink structure. This tool only works if you’ve chosen your new redirect to be
/%postname%/. Make your way to this page, scroll down and click on the orange button that says “Generate Redirects”. Fill out the form and generate the code you need. Copy this code and paste it at the top of your .htaccess file. The last step is to test your old links to see if they properly redirect to the permalink structure.
Backup solution – Redirect Plugin
If your not comfortable working in your .htaccess file, or your host doesn’t give you access to it, there are several WordPress plugins that will generate the desired effects.
I suggest Redirection by John Godley. Install this plugin before you change your permalink structure, then use the WordPress admin interface to redirect your posts. The plugin has a lot of useful features and lets you customize your redirects. Best of all, it generates 301s. Remember to test your links to make sure they are working properly!
Avoid Duplicate Content
WordPress is often rampant with duplicate content, which is a big SEO no-no. Duplicate content can be found on your index or blog page that shows all your recent posts, pagination, tags and categories pages, and archives.
It’s normal in WordPress blogs and sites to show a page that consolidates your posts and links to those individual posts. If these consolidated pages show the entire posts, search engines will index this as duplicate content and often times penalize you for it.
The biggest thing to remember and the easiest way to avoid this is to make sure your page templates use the WordPress function
the_excerpt rather than
the_excerpt will show a limited number of words from the post, as opposed to
the_content which will display the post content in its entirety. Search engines will index pages with excerpts and more than likely not consider this duplicate content.
Pagination, tags, categories, and archives pages are a different problem. While the content on these pages will be different, the title will be the same for each page, which presents a problem if you have lots of content. We can remedy this by suggesting to search engines what content to index and what content to leave out of their search results.
SEO Meta Tag Manipulation
After attending Nick Herinckx’s Mozinar, I was inspired to take his meta tag table a little further. The table below will let you know what types of pages you should index, and which you shouldn’t, as well as follow vs nofollow, whether or not to include the page type in your sitemap, and how to handle the page in your robots.txt.
I’ve taken the liberty of adding Galleries, as I’ve built a few sites that included a large number of image galleries. Some gallery plugins will create an individual post for each gallery, as well as provide you a shortcode to include in whatever post you desire. this is blatant duplicate content, and since we don’t actually use the posts that the gallery plugins generate, we should not index them and not include them in our sitemap.
The Yoast SEO plugin allows for this level of control.
Search engines include images and videos in a lot of their search results, and this is another opportunity that we should be taking advantage of. How to search engines correlate images and videos with keywords though? It’s a combination of the title tag, the alt tag, and content on the page around the image.
WordPress gives us easy control over the images title, alt, caption and description. Make sure you utilize these on every image you insert into your posts!
Statistics and Analytics
OK, so we’ve set our site up for success. How do we measure this success? We definitely want to utilize Google Analytics and Google and Bing Webmaster Tools.
Yoast SEO allows you to link up your Google and Bing webmaster tools accounts easily through its settings page.
To implement Google Analytics code on your site, you could manually insert the code into your
header.php file, but I would suggest using a plugin, like Google Analytics for WordPress, which is also by Yoast. This allows you control over your Google Analytics implementation, and has a handful of other advanced options you may want to consider.
There you have it. This beginners guide to WordPress SEO is no definitive guide, but it’s a good starting point. WordPress is always changing, and these methods might not always be the best ones. As of WordPress 3.5, I utilize the above methods in every site I build.
If you have any questions, please don’t hesitate to contact me via the comments below or via email at email@example.com.