How to Make Your WordPress Site SEO-Friendly

By on October 23rd, 2015

Although WordPress is SEO-friendly “out of the box,” there are several enhancements that you can make to allow your site to perform better in Google. This guide focuses on Google in particular because other search engines don’t have nearly as much traffic to offer as Google does. Therefore, it’s reasonable to focus your search engine optimization (SEO) techniques around what is important for helping Googlebot (the name of Google’s search engine crawler/spider) determine what your website is about so that it will be easier for people to find what they’re looking for. In addition, this guide pertains to “on-page optimization,” as opposed to “off-page optimization,” the latter of which involves building links to your site from other sites.

1) Use an SEO plugin.

The most popular ones are All-in-One SEO Pack (AIOSEOP) and Yoast, both of which are free. They have similar capabilities, and there are many reviews and “how to” guides available that can help you choose the best one for your needs.

2) Use an XML sitemaps plugin.

Your “sitemap” is a file in XML format with a .xml extension. It’s meant to be a convenient list of your site’s indexable file URLs, the dates that they were created, and how often they should be crawled, among other things. Like robots.txt, the sitemap is always placed in the root of your site. It should also be named sitemap.xml:

To alert Googlebot that you have such a file, you can place the following line in your robots.txt file:


It must be the absolute path as shown above, not the relative path. If you’re using WordPress, you can use a plugin called Google XML Sitemaps to handle the sitemap creation and automatic insertion of the sitemap’s path into your robots.txt file.

3) Use a caching plugin.

This is especially important if your site receives a lot of visitors. A caching plugin will make your pages load faster, which enhances the user experience and makes your site more appealing to Google, since page load time is now used as an SEO ranking factor. W3 Total Cache is the most popular plugin for this purpose.

4) Use an SEO-friendly theme.

Many WordPress themes today rely heavily on fancy graphics and an abundance of JavaScript/JQuery files. They may look pretty, but this style of design can make your site load slowly. For SEO purposes, a theme should be clean and simple, without a lot of graphical design elements that require huge .js files in order to function. Also avoid using external .js files because external scripts can slow down your site even more, especially if the domains where the scripts are hosted are experiencing technical problems.

5) Change the <h2> tag for the post/page title to an <h1> tag.

Unfortunately, a lot of WordPress themes use the <h1> tag for the site’s title in the header area, and they use the <h2> tag for the title of each page or post. The <h1> tag should be used for the post/page title, and there should be only one <h1> tag per page, so you would need to edit your theme’s header.php file to remove the <h1> tag. This may require some additional styling with CSS to make the title look the same as it did before removing the tag. Alternatively, you could use an image for the title/logo.

6) Use “canonical” URLs to avoid duplicate content.

A good SEO plugin will give you the option to do this, and the documentation should explain “URL canonicalization” in more detail.

7) Redirect the www version of your site to the non-www version or vice versa, depending on which one you’re using (the WordPress default is to use the non-www version).

For example, if someone tries to access your site by going to (A), he or she will be redirected to (B):


Google considers the URLs above to be two different websites, and it may choose to index only one of them because it sees the other as a duplicate. For SEO purposes, it doesn’t matter to Google which version you choose, as long as you’re consistent when creating internal and external links. You can ensure consistency by using a canonical URL for each page and post, as well as adding the following code to your .htaccess file in order to force all requests for the www version to be redirected to the non-www version:

Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,NC,L]

8) Make use of the “alt” and “title” attributes of the <img> tag.

Be sure to name your images appropriately, and use a relevant description of the image for the “alt” and “title” attributes. For example, if you had a picture of some birch trees in autumn, you could use the following code for the image:

<img src=”../../images/autumn-birch-trees.jpg” alt=”Autumn Birch Trees” title=”Autumn Birch Trees” />

The code above assumes that you keep your images in a directory called “images” located in the root of your site. Modify the code if necessary to ensure that the correct path to your image is used. The “alt” and “title” attributes enhance the user experience of your site, but they also make Googlebot aware of what the image is about and whether or not it’s relevant to the topic of your post or page. In addition, many people arrive at websites through searching on Google Images to find what they’re looking for. Having appropriately-named images and allowing them to be indexed in Google (some people block image directory crawling in the robots.txt file) may help your site receive more traffic.

9) Put a blank index.html file in each directory (except the root of your site) to prevent directory browsing by bots and people.

A “blank” index.html file is just a standard HTML file with no content inside the <body> and </body> tags. If you were to load the page in a browser, you would see nothing but white space. Adding such a file to directories that you don’t want anyone or anything to browse also prevents the contents from showing up in Google’s index. For example, suppose that you have private download pages that you store in a directory called “download.” If you didn’t have a blank index.html file in there and specify in your robots.txt that all search engines should refrain from crawling that directory, then the pages would be indexed, and people could also navigate to that directory and see links to every page within it. If you wanted to prevent search engines from crawing your downloads directory, you’d put this in your robots.txt file:

User-agent: *
Disallow: /downloads/

This assumes that the full path to your directory is The “*” means that all search engine bots should obey this rule, not just Googlebot.

Another technique to accomplish the same thing is to block directory browsing by putting the following line in your .htaccess file:

Options -Indexes

10) Use custom permalinks that describe the page/post content.

In the Permalinks area of your WordPress admin, select the custom option and use the following:


This will include the post’s title in the URL, as opposed to a non-descript date or numeric format that has no relevance to SEO. For example, if the title of your post is “Birch Trees in New York,” then your post URL would be:

11) If you allow comments on your posts, stay on top of spam.

Get rid of spam comments as soon as possible. The comments may contain content that is irrelevant to the topic of your post/page, and this may “confuse” Googlebot. Your rankings may suffer as a result.

12) Use meta descriptions that contain your keywords but also an enticing message that will make people want to click over to your site.

The keywords that a user searches for will show up in bold in the search results, which makes them stand out more, and the description should be worded in such a way that makes the user want to click on it. Writing effective meta descriptions is an art, but if you’re good at it, you may receive more visitors to your site than you otherwise would if you had a more generic or boring description. Incidentally, the meta keywords tag is no longer evaluated by Google in terms of SEO, but it may be useful for achieving a higher “quality score” on pay-per-click (PPC) landing pages.

This is not a comprehensive guide to on-page SEO, but it gives you the main points to consider when preparing your WordPress site for Google.

Leave a Reply