How to Add SEO to WordPress?


WordPress is good for search engine optimization (SEO), but it needs some fixing. Some changes and improvement are absolutely necessary for SEO.

The built-in features such as meta links for “next” and “prev” posts great for SEO. Also, the ability to change the permalink and include post slug (text with hyphens) makes a big impact on SEO.

1) Permalinks With Keyword Slug

In the WordPress permalink settings, you can set how the post URLs will appear. For SEO, the URL should include keywords for which you want to rank.

Hence, your permalink must be set to include the title slug. This permalink URL slug can also be customized via the Permalink settings under the document settings panel on the create / edit page for posts and pages.

2) Install SEO Plugin

WordPress doesn’t provide control over SEO elements and optimization. You need a SEO plugin so that you can fine-tune the SEO title and description. You can also control what pages and posts are allowed to appear in search indexes. Plus, many more controls that are necessary to take the best advantage of SEO.

SEOPress & Yoast SEO are two good plugins. You can choose any SEO plugin as long as it allows you to control the indexing and other settings that are discussed here.

WordPress has some archiving systems that are rarely useful in modern blogging. For instance, the date, month and year based archives is not required for standard blogs.

3) Disable & Noindex Irrelevant Archives

Having archives which only create duplicate pages is not good for SEO. When you have a page with the same content, Google looks at it as a duplicate. It’s not a great idea to have duplicate content on your website.

You should disable and / or set to “noindex” the following post archives:

  • Author archives (disable / noindex, unless your blog has multiple authors)
  • Date-based archives (disable/ noindex, unless your blog is designed for date-wise viewing)
  • Category archives (noindex)
  • Tag archives (noindex)
  • Taxonomy archives (noindex)
  • Search results page (noindex)

What is “noindex” and “nofollow” in SEO?
When you add a “noindex” meta tag to a webpage, search engines are asked not to index the page. You can use it to keep some webpages from appearing in Google, Yahoo, Bing, etc. Any webpage or link with a “nofollow” rel tag asks search engines not to follow the link. Contrary to the semantics, adding nofollow does not prevent search engines from heading to the link destination. It is a way of letting Google know that you don’t want to pass any recommendation to the webpage through your hyperlink.

You will need to install a WP SEO plugin to manage & disable these archives. SEOPress does all of the above, and Yoast SEO supports most of them.

4) Disable Media Attachment Page

WordPress creates an attachment page (with its own URL) for each image, PDF and other media that is uploaded. So, it creates one webpage (with comment form, if enabled) for each image or video that you upload.

Media attachment pages have little use in general blogging. Instead, it creates a nuisance in terms if SEO. How? Each attachment page is a low-quality webpage without much content. Google doesn’t really like it.

Disable the media attachment page. Both SEOPress and Yoast SEO has the option to redirect media attachment page to media itself.

5) SEO Title & Description for Homepage

Generally, WP themes set your homepage (or main website URL) to have the title as the blog name with or without the blog tagline. And, themes do not add any description.

Using your WP SEO plugin, you should add an SEO title and description of the website homepage. If you are using a static page set as homepage, you might have to change the setting within in page if using Yoast SEO.

6) Add Your Social Media Links

For SEO purposes and also better sharing on social media, you need to include your social media handles with proper meta tags that are recognized by the platforms.

Using SEO plugins, you add your username / handles for popular social media platforms such as Facebook, Twitter, Instagram and Pinterest.

7) Author or Organization Settings

For blog and website publications, you can add special meta tags that provide information regarding the author and / or publishing organization. Use SEO plugins to properly set this up.

8) Add XML Sitemaps

XML sitemaps help search engines navigate your website easily. Basically, XML sitemaps are like a directory where all your posts and pages are listed along with date of publication and last update. It allows for easy indexing and updating of your site by Google and other search engines. Most SEO plugins have the option to enable XML sitemaps. If not, you can use a standalone plugin for adding sitemaps to your WordPress site. Add your XML sitemap URL link in your footer or secondary menu so that Google can find and use the sitemap.

9) WordPress Site Caching

With dynamic website platforms such as WordPress, all the webpages and content is served via information saved in a database. This means each request for a webpage requires the hosting server to process the information and deliver. When there are lots of visitors, it can be a lot of work for your website server. In turn, your web server starts performing slowly and visitors many even not be able to access the site.

Website caching is a system that renders static webpage HTML files for your dynamic webpages. So, instead of accessing the database and processing the data, your website is served from cached (saved) webpages. This reduces the load on your web server. Thus, the site loads faster.

Website’s speed is an important factor in determining its web ranking. Enabling website caching for your site helps speed up your website and boost your website SEO.

You can install WP Super Cache or any desired caching plugin.

10) 301 Redirection for 404 Error

Redirect all 404 errors (missing URLs) to homepage (or any other page) on this site using 301 (permanently moved) message. It will help your website retain visitors as well as SEO juice. There is a WP plugin for this: 404 to 301.

Bonus WP SEO Tips

A few other things can also be implemented to improve WordPress SEO.

Add Analytics Code

For better tracking your blog’s traffic and visitors, you should add some visitor tracking and analytics. It doesn’t have a direct impact on SEO, but can be really helpful for SEO implementation.

Google Analytics is one of the most popular options. Get an account with Google Analytics using your Google account, add your website for tracking, generate the tracking code and add it in your WordPress site.

Google Webmasters / Search Console

Like Google Analytics, Google Search Console does not influence your search rankings. Instead, it provides you data related to your website rankings and performance in Google search.

Get your website property added and verified with Google Search Console. Thereafter, add your website XML sitemap for fast indexing by Google.

Add robots.txt File

A “robots.txt” file tells search engines whether they can access and crawl parts of your site. This file, which must be named “robots.txt”, is placed in the root directory (the public_html folder, or the folder where your main homepage files are hosted) of your website.

A robots.txt file is used mainly to avoid overloading your site with requests from crawlers. Google can still index the pages even when barred by the file. To keep a web page out of Google, you should use noindex directives, or password-protect your page.

You can learn about how to create a robots.txt file and the various directives on Google Webmasters Support.

Here’s a sample content for robots.txt.

/* Disallow Crawling by All Bots*/
User-agent: *
Disallow: /cgi-bin/
Disallow: /wp-admin/
Disallow: /wp-includes/
/* Google Bot*/
User-agent: Googlebot
Allow: /
/* Google Adsense*/
User-agent: Mediapartners-Google
Allow: /

Some more steps that can be taken to indirectly help with SEO.

  • Disable individual links for comments. When someone leaves a comment on a post, the comment gets a reference link of its own. Disabling this link is better in terms on SEO.
  • Disable trackbacks and pingbacks: Though no SEO benefit, it can save a lot of unwanted trackback spam. Many people add link to your site just for a trackback mention in your comment section. Also, when you disable pingbacks from your website, other bloggers are spared the pain. It has an obvious drawback: you lose the benefit of some exposure.