How to Add Hreflang Tags in WordPress

Do you want to add hreflang tags in your WordPress posts and pages? If you publish content in multiple languages or for different regions, then hreflang tag helps you improve SEO for those regions and languages. In this article, we will show you how to… Read More »

The post How to Add Hreflang Tags in WordPress appeared first on WPBeginner.

Do you want to add hreflang tags in your WordPress posts and pages? If you publish content in multiple languages or for different regions, then hreflang tag helps you improve SEO for those regions and languages. In this article, we will show you how to easily add hreflang tags in WordPress without writing a single line of code.

How to add hreflang tags in WordPress

What is hreflang tag?

Hreflang tag allows you to tell search engines which page to show for a particular region and language. You can also use it to define other variations of the same content in different languages.

Here is how a hreflang tag implementation looks like in plain HTML.

<link rel="alternate" href="example.com" hreflang="en-us" />
<link rel="alternate" href="example.com/fr/" hreflang="fr-fr" />
<link rel="alternate" href="example.com/pt/" hreflang="pt-pt" />

The hreflang tag is a combination of the language code and the region code. For example, en-us for English and the United States, fr-fr for French and France, and so on.

WordPress is available in more than 60 languages, and you can use WordPress in your own language.

Many WordPress site owners target users in different regions and languages. Some do that by creating multilingual websites, while others do that by offering some content in other languages.

Search engines can easily detect the language of a page and automatically match it to the language settings on user’s browser. However, your pages may still be competing with each other in the search results which may affect your site’s SEO.

You can implement hreflang tags to fix that. Let’s see how to easily add hreflang tags in WordPress.

Method 1: Add hreflang Tag in WordPress Using a Multilingual Plugin

The best approach to building a multilingual WordPress site is by using a multilingual plugin. A multilingual WordPress plugin allows you to easily create and manage content in multiple languages using the same WordPress core software.

These plugins will automatically take care of all technical things such as the hreflang tag, so you can focus on creating content.

We recommend using Polylang. It is a free WordPress plugin and comes with a very powerful and easy to use interface to manage multilingual content. For detailed instructions, see our guide on how to how to easily create a multilingual WordPress site.

Adding languages in Polylang

Another popular option is WPML. It is a premium WordPress plugin with an easy to use interface to create multilingual content on your website. For step by step instructions, see our guide on how to create a multilingual WordPress site with WPML.

After you have created some posts or pages in multiple languages, you need to visit them in a new browser window. Right click and select ‘View Page Source’ from your browser menu.

This will open the source code of the post or page. Now you need to look for hreflang tag to verify that it is working properly. You can also use CTRL+F (Command+F) keys to find the hreflang tag.

Method 2: Add Hreflang Tags in WordPress Without Using a Multilingual Plugin

This method is for users who are not using a multilingual plugin to manage translations on their websites.

First thing you need to do is install and activate the HREFLANG Tags Lite plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, the plugin will add a new menu item labeled HREFLANG in your WordPress admin menu. Clicking on it will take you to the plugin’s settings page.

hreflang tag plugin settings

Select the post types where you’d like to enable the plugin and then click on the save changes button to save your settings.

Next, you need to edit the post or page where you want to add the hreflang tag. On the post edit screen, you will notice a new metabox labeled HREFLANG tags.

Adding hreflang tags using a plugin

First you need to add the URL of the post that you are currently editing and then select its language. After that you need to click on the plus button to add URLs of other variations of the post and their language.

Once you are done, click on save or update button to save your post.

You can now visit your post in a browser window and view its source code. You will see the hreflang tag added to your post.

We hope this article helped you learn how to easily add hreflang tag to your WordPress site. You may also want to see our step by step WordPress SEO guide for beginners.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Add Hreflang Tags in WordPress appeared first on WPBeginner.

How to Add Keywords and Meta Descriptions in WordPress

Do you want to properly add keywords and meta descriptions in WordPress? Meta keywords and meta descriptions allow you to improve your website’s SEO. In this article, we will show you how to properly add meta keywords and meta descriptions in WordPress. Why Add Keywords… Read More »

The post How to Add Keywords and Meta Descriptions in WordPress appeared first on WPBeginner.

Do you want to properly add keywords and meta descriptions in WordPress? Meta keywords and meta descriptions allow you to improve your website’s SEO. In this article, we will show you how to properly add meta keywords and meta descriptions in WordPress.

Why Add Keywords and Meta Descriptions in WordPress?

Keywords and descriptions allow you to tell search engines more about the content of your posts and pages.

Keywords are important words or phrases that people are likely to search for if they were looking for the content you are publishing. Meta description is a brief description of what your page or post is about.

Description used by search engines

Meta keywords and description are actually HTML meta tags, and they go into your website’s header. WordPress SEO plugins make it super easy for you to add them from your WordPress admin area for each post and page on your website.

How important are meta keywords and descriptions for SEO?

Search engines don’t exactly share how much weight they assign to keywords or description. However, it is quite obvious that they are important and help you rank better.

Some SEO experts believe that keywords are not at all important. Even Google says that they don’t give importance to meta keywords. However, other SEO experts disagree and advise users to keep adding meta keywords.

On the other hand, meta description is extremely important because you can use it to grab user’s attention.

Having said that, let’s take a look at how to easily add keywords and meta description in WordPress.

Note: For the sake of this tutorial we will be using Yoast SEO plugin. For more details, see our step by step guide on how to install and setup Yoast SEO plugin for WordPress.

Enable Meta Keywords Support in Yoast SEO

Yoast SEO comes with built-in support for description and meta keywords. However, the meta keywords feature is turned off by default.

First you will need to enable it in order to use meta keywords on your WordPress site.

You will start by visiting SEO » Dashboard page and then click on the ‘Features’ tab.

Advanced settings pages

Now you need to click on ‘Enabled’ under ‘Advanced settings pages’ option and then click on save changes button to store your changes.

Yoast SEO settings page will now reload and you will be able to see a lot more options under the SEO menu.

Headover to SEO » Titles & Meta page and then click on the ‘Other’ tab.

Enable meta keywords

Now you need to click on ‘Enabled’ under ‘Use meta keywords tag?’ option and then click on the save changes button.

You have successfully enabled meta keywords support in Yoast SEO plugin for WordPress. You can now add meta keywords to your posts and pages.

Keywords and Descriptions for WordPress Posts / Pages

First you need to edit a post or page where you want to add keywords and meta description.

Scroll down a little to ‘Yoast SEO’ meta box below the post editor.

You will see your site’s title and automatically generated description as a snippet. Below that you will see Meta Keywords field.

Adding meta keywords in Yoast SEO for WordPress

You need to enter your keywords separated by a comma. Don’t use more than 10 keywords or phrases.

Make sure that you only use keywords that are relevant to your content and that you have already used those keywords or phrases inside your article.

Now you need to click on the ‘Edit Snippet’ button and enter your site’s description. This will turn the snippet preview into an editable area.

Edit description

Make sure that you use your main keyword at least once in your description.

After that click on the ‘Close snippet editor’ button when you are done. You will be able to see your custom description in the snippet preview now.

Congratulations, you have successfully added meta keywords and description to your WordPress post. You can now save or publish your post or page.

Adding Keywords and Meta Description for Homepage

You can also add keywords and description for your site’s homepage in WordPress. Here is how to do that using Yoast SEO plugin.

Headover to SEO » Titles & Metas page and then click on the ‘Homepage’ tab. Here you can add a custom title, description, and meta keywords for your site’s homepage.

homepage keywords and description

Don’t forget to click on the save changes button to store your settings.

Meta Keywords and Description for Category Archives

You can also add keywords and description to your category and tag archive pages.

First you need to visit Posts » Categories page. Take your mouse over to the category you want to edit and then click on the ‘Edit’ link.

Edit category

This will open the category editor page where you need to scroll down to Yoast SEO meta box.

Now you need to click on the Edit Snippet button to enter your own description of the category.

Editing meta description for category archive in WordPress

After that you need to click on the ‘Settings’ button to enter meta keywords to be used for that particular category’s archive pages.

Adding meta keywords for a category archive page in WordPress

Don’t forget to click on the ‘Update’ button store your settings.

You can repeat the process to add keywords and descriptions to your tags and other custom taxonomy archives.

That’s all, we hope this article helped you learn how to easily add keywords and meta description to your WordPress posts and pages. We recommend that you add custom meta description and keywords to every blog post and page that you create.

You may also want to see our ultimate WordPress SEO guide for beginners.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Add Keywords and Meta Descriptions in WordPress appeared first on WPBeginner.

How to Hide a WordPress Page From Google

Recently, one of our readers asked if it was possible to hide a WordPress page from Google? Sometimes you may need to hide a page from Google to protect your privacy or to keep away unwanted users. In this article, we will show you how… Read More »

The post How to Hide a WordPress Page From Google appeared first on WPBeginner.

Recently, one of our readers asked if it was possible to hide a WordPress page from Google? Sometimes you may need to hide a page from Google to protect your privacy or to keep away unwanted users. In this article, we will show you how to hide a WordPress page from Google without affecting your site’s overall SEO.

Hiding a WordPress post or page from Google

Hiding a WordPress Post or Page From Google

Search engines like Google allow website owners to exclude content from search results. You can do this by using your site’s robots.txt file or using HTML meta tags.

We will show you how to do this in WordPress using two methods. You can choose the one that works best for you.

We will also show you how to password protect posts and pages in WordPress. If you don’t want to use the first two methods, then this approach will allow you to control the visibility of your posts and pages for all users.

Method 1: Hide a WordPress Page from Search Engines Using Yoast SEO

This method is easier and recommended for beginners.

First thing you need to do is install and activate the Yoast SEO plugin. For more details, see our step by step guide on how to install a WordPress plugin.

If you are new to Yoast SEO, then you may want to see our guide on how to install and set up Yoast SEO plugin.

Next, you need to edit the post or page that you want to hide from search engines. Scroll down to the Yoast SEO meta box below the post editor and click on the advanced settings button.

Hiding a WordPress post or page from Google using Yoast SEO

The advanced settings section allows you to add meta tag robots to your blog posts or pages. Using the robots meta tag, you can tell search engines not to index or follow a page.

First you need to select ‘noindex’ from the drop down menu next to ‘Meta robots index’ option. After that, click on ‘nofollow’ next to ‘Meta robots follow’ option.

You can now save/publish your post or page.

Yoast SEO will now add this line of code to your post or page:

<meta name="robots" content="noindex,nofollow"/>

This line simply tells search engines not to follow or index this page.

Method 2: Hide a WordPress Page from Search Engines Using robots.txt File

This method requires you to edit the robots.txt file. Adding incorrect instructions in this file can have adverse affect on your site’s SEO, which is why it is not recommended for beginner users.

The robots.txt file is a configuration file that you can add to your WordPress site’s root directory. It allows a website to provide instructions for search engine bots, hence the name robots.txt.

For more information, take a look at our guide on how to optimize your WordPress robots.txt for SEO.

You can edit robots.txt file by connecting to your website using an FTP client or ‘File Manager’ in your WordPress hosting cPanel.

You will need to add these lines to your robots.txt file.

User-agent: *
Disallow: /your-page/

The user-agent line allows you to target specific bots. We are using asterisk sign to include all search engines.

The next line defines the part of the URL that comes after your domain name.

Now let’s assume that you want to hide a blog post with a URL like this:

http://example.com/2016/12/my-blog-post/

Here is how you will add this URL to your robots.txt file.

User-agent: *
Disallow: /2016/12/my-blog-post/

Don’t forget to save your changes and upload robots.txt file back to your server.

Disadvantages of Using robots.txt to Hide Content

First you need to keep in mind that robots.txt file is publicly accessible. Anyone can access it directly to see if there are any pages you are trying to hide.

While most search engines follow the instructions in robots.txt file, many other crawlers and bots may simply ignore it. These are the bots crawling the web to spread malware, target websites, or harvest information like email accounts, phone numbers, etc.

Method 3: Password Protect a Post or Page in WordPress

This method uses a different approach. Instead of asking search engines not to index a page, you can password protect it, so that it is only visible to users with the password.

WordPress comes with a built-in feature to password protect posts and pages. Simply edit the post or page that you want to protect.

Under the publish meta box, click on the ‘Edit’ link next to ‘Visibility’ option.

Edit visibility option for a post or page

This will show the visibility options available in WordPress. You can keep a post/page public, make it private, or password protect it.

Private posts are only available to logged in users who have at least editor user role on your website.

Password protected posts can be seen by any visitor who has the password. Click on password protected option and then enter a strong password.

Setting password protection for post in WordPress

You can now publish or save your post/page.

Now visitors accessing the post or page on your website will be asked to enter the password to view the content.

Password protected content

For more detailed instructions, see our guide on how to password protect posts and pages in WordPress.

That’s all, we hope this article helped you learn how to hide a WordPress page from Google. You may also want to see our guide on how to stop search engines from crawling a WordPress site.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Hide a WordPress Page From Google appeared first on WPBeginner.

Ultimate WordPress SEO Guide for Beginners (Step by Step)

Improving your WordPress SEO is crucial for getting more traffic to your website. Sadly most WordPress SEO guides are too technical for new users to get started. If you are serious about increasing your website traffic, then you need to pay attention to the WordPress… Read More »

The post Ultimate WordPress SEO Guide for Beginners (Step by Step) appeared first on WPBeginner.

Improving your WordPress SEO is crucial for getting more traffic to your website. Sadly most WordPress SEO guides are too technical for new users to get started. If you are serious about increasing your website traffic, then you need to pay attention to the WordPress SEO best practices. In this guide, we will share the top WordPress SEO tips to help you improve your WordPress SEO and get more organic traffic.

WordPress SEO for Beginners

You might have heard experts saying that WordPress is SEO friendly. This is actually why a lot of people choose WordPress to start a blog or website.

While WordPress makes sure that the code it generates follows the SEO best practices, there is a lot more you need to do if you want to maximize your SEO efforts.

We have a number of actionable steps that you need to take to properly optimize your WordPress SEO.

To make it easy, we have created a table of content to help you easily navigate through our ultimate WordPress SEO guide.

Table of Contents

Introduction

The Basics of WordPress SEO

The Best WordPress SEO Plugin

WordPress SEO Best Practices

Speed and Security for WordPress SEO

Finally, see more SEO tools and resources to take your WordPress SEO even farther.

Introduction

We know the idea of optimizing for WordPress SEO can be intimidating for beginners, especially if you’re not not a tech geek.

But don’t worry — it doesn’t have to be complicated. Start here to learn the basics, and then you can start applying them to your own website.

What is SEO?

What is SEO?

SEO is an acronym that stands for Search Engine Optimization. It’s a strategy used by website owners to get more traffic by ranking higher in search engines.

Search engine optimization isn’t about tricking Google or gaming the system. It’s simply about creating a website that has optimized code and formatting which makes it easy for search engines to find your website.

When people search the web for the topics you write about, your search-engine-optimized content will appear higher in the search results, and you’ll get more people clicking through to your website.

[Back to top ↑]

Why SEO is important

Search engines are often the biggest source of traffic for most websites.

Google and other search engines use advanced algorithms to understand and rank pages appropriately in search results. But those algorithms aren’t perfect — they still need your help to understand what your content is about.

If your content isn’t optimized, then search engines won’t know how to rank it. When people search for the topics you write about, your website won’t appear in the search results, and you’ll miss out on all that traffic.

It is really important for all business owners to make their website search engine friendly, so that they can maximize their search traffic.

[Back to top ↑]

Basics of WordPress SEO

SEO can get technical, but it doesn’t have to be. Just learning a few basic SEO tips to optimize your site can give you a noticeable boost in your website traffic.

You don’t have to be a tech genius to use the techniques below. If you’re already using WordPress, then you’ve got what it takes!

Let’s get started optimizing your website.

Check Your Site’s Visibility Settings

WordPress comes with a built-in option to hide your website from search engines. The purpose of this option is to give you time to work on your website before it’s ready to go public.

However, sometimes this option can get checked accidentally and it makes your website unavailable to search engines.

If your website is not appearing in search results, then the first thing you need to do is to make sure that this option is unchecked.

Simply log in to the admin area of your WordPress site and visit Settings » Reading page.

Search engine visibility settings in WordPress

You need to scroll down to the ‘Search Engine Visibility’ section and make sure that the box next to ‘Discourage search engines from indexing this site’ is unchecked.

Don’t forget to click on the ‘Save Changes’ button to store your changes.

[Back to top ↑]

SEO friendly URLs contain words that clearly explain the content of the page, and they’re easy to read by both humans and search engines.

Some examples of SEO friendly URLs are:

http://www.wpbeginner.com/how-to-install-wordpress/
http://www.wpbeginner.com/common-wordpress-errors-and-how-to-fix-them/

Notice that these URLs are readable and a user can guess what they will see on the page just by looking at the URL text.

So what does a non-SEO friendly URL look like?

http://www.wpbeginner.com/?p=10467
http://example.com/archives/123

Notice that these URLs use numbers unrelated to the content, and a user cannot guess what they will find on the page by looking at the URL.

Using SEO friendly permalink structure improves your chances of getting better positions in search results.

Here is how you can check and update your WordPress site’s permalink structure.

You need to visit the Settings » Permalinks page. Select the post name option and then click on the ‘Save Changes’ button to store your settings.

SEO friendly URL structure in WordPress

For more detailed instructions take a look at our guide on what is a SEO friendly URL structure in WordPress.

Note: If your website has been running for more than 6 months, then please don’t change your permalink structure unless you’re using the numbers option. If you’re using Day and Name or Month and Name, continue using that.

By changing your permalink structure on an established site, you will lose all of your social media share count and run the risk of losing your existing SEO ranking.

If you must change your permalink structure, then hire a professional, so they can setup proper redirects. You’ll still lose your social share counts on the pages.

[Back to top ↑]

WWW vs non-WWW

If you are just starting out with your website, then you need to choose whether you want to use www (http://www.example.com) or non-www (http://example.com) in your site’s URL.

Search engines consider these to be two different websites, so this means you need to choose one and stick to it.

You can set your preference by visiting the Settings » General page. Add your preferred URL in both the ‘WordPress Address’ and ‘Site Address’ fields.

Non-www or www in WordPress URLs

Despite what someone else might say, from a SEO standpoint there’s no advantage to using one or another.

For more detailed information on this topic, take a look at our guide on www vs non-www – which is better for WordPress SEO.

[Back to top ↑]

The Best WordPress SEO plugin

One of the best part about WordPress is that there’s a plugin for everything, and SEO is no exception. There are thousands of WordPress SEO plugins which makes it harder for beginners to choose the best WordPress SEO plugin.

Instead of installing separate plugins for individual SEO tasks, we will help you choose the best WordPress SEO plugin that does it all, and it’s 100% free.

Choosing the Best WordPress SEO Plugin

Choosing the best WordPress SEO plugin

When it comes to choosing the best WordPress SEO plugin, you will most likely narrow your choices down to the two most popular solutions: Yoast SEO or All in One SEO Pack.

They are both effective solutions, and we’ve done a pros and cons comparison of Yoast SEO vs All in One SEO Pack.

At WPBeginner, we use Yoast SEO, so in this tutorial we’ll be using Yoast SEO for screenshots and examples.

Regardless, we have a step by step guide on properly setting up each of these plugins:

[Back to top ↑]

Add XML Sitemaps in WordPress

xml sitemap

An XML Sitemap is a specially formatted file that lists every single page on your website. This makes it easy for search engines to find all of your content.

While adding an XML sitemap does not boost your site’s search rankings, it does help search engines find the pages quickly and start ranking them.

If you’re using the Yoast SEO plugin, then it will automatically create an XML sitemap for you. To find your sitemap, just go to this URL (don’t forget to replace example.com with your own domain name):

http://example.com/sitemap_index.xml

We will show you how to submit your XML sitemap to Google in the next step.

[Back to top ↑]

Add Your Site to Google Search Console

Google Search Console

Google Search Console also known as Webmaster Tools is a set of tools offered by Google to give website owners a look at how their content is seen by the search engine.

It provides reports and data to help you understand how your pages appear in search results. You also get to see the actual search terms people are using to find your website, how each page appears in the search results, and how often your pages are clicked.

All this information helps you understand what’s working on your site and what’s not. You can then plan your content strategy accordingly.

Google Search Console also alerts you when there is something wrong with your website, like when search crawlers are unable to access it, find duplicate content, or restricted resources.

We have a step by step guide on how to add your WordPress site to Google Search Console.

If you’re using Yoast SEO, then follow step 11 in our Yoast SEO setup guide.

If you’re not using Yoast SEO, then you can watch our video that shows an alternative way:

Once you have added your website to Google Search Console, click on the Crawl menu and then select Sitemaps.

Crawl section in Google Search Console

After that you need to click on the Add Sitemap button.

Adding your wordpress xml sitemap in Google webmaster tools

Your main sitemap is sitemap_index.xml so go ahead and submit that.

Once you have successfully added your sitemap, it will appear as pending. It does take Google some time to crawl your website. After a few hours, you would be able to see some stats about your sitemap. It will show you the number of links it found in your sitemap, how many of them got indexed, a ratio of images and web pages, etc.

We recommend that you check your Search Console at least on a monthly basis for gathering insights and see your website’s SEO progress.

[Back to top ↑]

Optimizing Your Blog Posts for SEO

Often beginners make the mistake of thinking that installing and activating a WordPress SEO plugin is all what’s needed. SEO is an ongoing process that you must keep up with if you want to see maximum results.

Yoast SEO allows you to add a title, description, and focus keyword to to every blog post and page. It also shows you a preview of what users will see when they Google your website.

We recommend that you optimize your title and description to get maximum clicks.

When writing your blog post, simply scroll down to the Yoast SEO section and take full advantage of it.

Yoast SEO meta box

If you’re wondering how to choose a focus keyword, what is a good title, or what is a good meta description, then we have covered it in details in our beginners guide to optimize your blog posts for SEO.

We highly recommend that you read it because on-page SEO is crucial for your success.

[Back to top ↑]

WordPress SEO Best Practices

If you follow the basics of WordPress SEO and use the best WordPress SEO plugin, you will already be ahead of most websites.

However if you want even better results, then you need to follow the WordPress SEO best practices below.

These aren’t too technical and most won’t even require you to touch any code. But they will make a big difference if you follow them.

Properly Using Categories and Tags in WordPress

Category and tags

WordPress allows you to sort your blog posts into categories and tags. This makes it easy for you to manage your content by topics, and for your users to find the content they’re looking for.

Categories and tags also help search engines understand your website structure and content.

Often beginners get confused on how to best use categories and tags. After explaining this to thousands of readers, here’s how we approach categories and tags.

Categories are meant for broad grouping of your posts. If your blog was a book, then categories will be the table of content.

For example, on a personal blog you can have categories like music, food, travel, etc. Categories are hierarchical, so you can add child categories to them.

On the other hand, tags are more specific keywords that describe the contents of an individual post. For example, a blog post filed under food category can have tags like salad, breakfast, pancakes, etc. Think of these as indexes section in a text book.

For more on this topic, see our guide on categories vs tags and SEO best practices for sorting your content.

By using categories and tags properly, you make it easy for your users to browse your website. Since it’s easy for users, it also makes it easier for search engines to browse your website.

[Back to top ↑]

Make Internal Linking a Habit

Internal linking in WordPress

Search engines assign each page on your website a score (page authority). The recipe of this score is kept secret so that people cannot game the results. However, the most common signals of authority are links.

This is why it’s important that you link to your own content from your other blog posts and pages.

You should make it a habit to interlink your own posts whenever possible. If you have multiple authors, then create a pre-publish blog post checklist that requires them to interlink at least 3 other blog posts.

This will help you boost your pageviews, increases the time users spend on your site, and ultimately will improve the SEO score of your individual blog posts and pages.

[Back to top ↑]

Optimize WordPress Comments

Optimize WordPress comments

Comments can be a strong indication of user engagement on your website. Engaged users means more links back to your site, more traffic, and improved SEO.

But you need to make sure that your comments are real and not spam. Spammers submit comments with bad links which could affect and even ruin your search rankings.

This is why we recommend everyone to start using Akismet. It is one of the two plugins that come pre-installed with every WordPress site, and it helps you combat comment spam.

If Akismet alone is unable to handle comment spam, then see these tips and tools to combat comment spam in WordPress.

If your blog posts attract a lot of genuine, spam-free comments, then you should pat yourself on the shoulder for building such an engaging website!

However, too many comments on a post can make it load slower which also affects your search engine rankings. (Keep reading below to find out more about how speed affects SEO.)

To prepare your website so that it can handle the burden your comments put on your server and speed, you can split comments into multiple pages. See our tutorial on how to paginate comments in WordPress.

(If you’d like to get more comments on your site, check out these 11 ways to get more comments on your WordPress blog posts.)

[Back to top ↑]

NoFollow External Links in WordPress

NoFollow external links

As mentioned above, links help search engines decide which pages are important. When you link to a website, you are passing some of your site’s SEO score to that link. This SEO score is called “link juice.”

For good search rankings you need to make sure that you are getting more link juice from other websites than you are giving away.

Adding the “nofollow” attribute to external links (links to websites that you don’t own) instructs search engines not to follow those links. This helps you save link juice.

A normal external link looks like this in HTML:

<a href="http://example.com">Example Website</a>

An external link with the nofollow attribute looks like this:

<a href="http://example.com" rel="nofollow">Example Website</a>

You can also add rel=”nofollow” checkbox to the insert link popup. This will allow you to easily add nofollow to external links.

[Back to top ↑]

Full Posts vs Summaries or Excerpts

Full posts vs summary or excerpts

WordPress displays and links to your posts from a number of pages like home page, category archive, tags archive, date archive, author pages, etc.

By default, it shows the full article content on all these pages. This affects your site’s SEO, as search engines may find it to be duplicate content. Full articles also make your archive pages load slower.

Showing full articles everywhere also affects your page views. For example, users who subscribe to your RSS feed will be able to read the full article in their feed reader without ever visiting your website.

The easiest way to solve this is by showing summaries or excerpts instead of full articles.

You can do this by going to Settings » Reading and select summary.

For detailed instructions, see our guide on how to customize WordPress excerpts without coding.

[Back to top ↑]

Speed and Security for WordPress SEO

Even if you follow all the WordPress SEO tips and best practices above, if your site is slow or gets taken down by a hacker, your search engine rankings will take a big hit.

Here’s how to prevent your site from losing search engine traffic due to slow performance or lax security.

Optimize Your Site’s Speed and Performance

Optimize your WordPress site's speed and performance

Research shows that in the internet age, the average human attention span is shorter than that of a goldfish.

Web usability experts believe that users decide whether they want to stay or leave within few seconds of visiting a website.

That means that as a website owner, you only have a few seconds to present your content and engage users. You don’t want to waste this precious time making your visitor wait for your website to load. Search engines like Google admit that they rank faster websites higher than slow loading websites.

If you need to improve your site’s speed, check out this expert advice on 18 useful tricks to speed up WordPress and boost performance.

[Back to top ↑]

Optimizing Images in WordPress for SEO

Images are more engaging than text but they also take more time to load. If you are not careful with image sizes and quality, then they can slow down your website.

You need to make sure that you use images that are optimized to load faster. See our guide on how to speed up WordPress by optimizing images for the web.

Another trick you can use to optimize your images for search engines is to use descriptive title and alt tags. These tags help search engines understand what your image is about. They also help users with visual impairment as their screen readers can read the alt and title tags to them.

WordPress allows you to add title and alt tags when you upload an image.

Add alt and title tags to your images in WordPress

If you are a photographer or add a lot of images to your WordPress site, then you need to use a gallery plugin.

We recommend using Envira Gallery. In our speed tests, we found it to be the fastest WordPress gallery plugin. It’s also fully responsive and SEO friendly out of the box.

[Back to top ↑]

Security and Safety of Your WordPress Site

WordPress security

Each week, Google blacklists around 20,000 websites for malware and around 50,000 for phishing. When a site is blacklisted, it doesn’t show up in any search results at all.

This means that the security of your WordPress site is crucial for good rankings. You don’t want all your hard work on SEO to go to waste if your site is compromised by a hacker.

The good news is that it’s not that difficult to keep your WordPress site safe — see the step by step instructions in our ultimate WordPress security guide.

At WPBeginner, we use Sucuri to protect our website against attacks. To see why we recommend this service, check out our case study of how Sucuri helped us block 450,000 WordPress attacks in 3 months.

[Back to top ↑]

Start Using SSL/HTTPS

A site secured by SSL and HTTPS

SSL (Secure Sockets Layer) is a technology that encrypts the connection between a user’s browser and the server they are connecting to. This adds an additional security layer to your WordPress site.

Websites secured with SSL are indicated by a padlock sign in the browser’s address bar. This makes your website more trustworthy, and it is required if you are running an online store with WordPress and processing sensitive payment information.

If you are using Bluehost, then you can purchase a SSL certificate. If you’re going to purchase your SSL certificate through your web hosting company, see our guide on how to add SSL and HTTPS in WordPress.

You can also get free SSL with Let’s Encrypt. Several WordPress hosting companies like Siteground, Dreamhost, and WPEngine have already started offering easy Let’s Encrypt integrations.

For step by step instructions, see our guide on how to add free SSL in WordPress with Let’s Encrypt.

[Back to top ↑]

More SEO Tools and Resources

Once you get the hang of WordPress SEO best practices, you’ll want to take your skills even further to get ahead of your competition.

We have compiled a list of best WordPress SEO plugins and tools that you should use to boost your SEO. If you’re ready to try some more advanced techniques, you can also check out our archive of WordPress SEO articles.

[Back to top ↑]

We hope this article helped you learn how to properly optimize your WordPress site for SEO. Go ahead and implement a few of these WordPress SEO tips, and you should see an increase in your traffic within a few months as the search engines process your changes.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post Ultimate WordPress SEO Guide for Beginners (Step by Step) appeared first on WPBeginner.

Ultimate WordPress SEO Guide for Beginners (Step by Step)

Improving your WordPress SEO is crucial for getting more traffic to your website. Sadly most WordPress SEO guides are too technical for new users to get started. If you are serious about increasing your website traffic, then you need to pay attention to the WordPress… Read More »

The post Ultimate WordPress SEO Guide for Beginners (Step by Step) appeared first on WPBeginner.

Improving your WordPress SEO is crucial for getting more traffic to your website. Sadly most WordPress SEO guides are too technical for new users to get started. If you are serious about increasing your website traffic, then you need to pay attention to the WordPress SEO best practices. In this guide, we will share the top WordPress SEO tips to help you improve your WordPress SEO and get more organic traffic.

WordPress SEO for Beginners

You might have heard experts saying that WordPress is SEO friendly. This is actually why a lot of people choose WordPress to start a blog or website.

While WordPress makes sure that the code it generates follows the SEO best practices, there is a lot more you need to do if you want to maximize your SEO efforts.

We have a number of actionable steps that you need to take to properly optimize your WordPress SEO.

To make it easy, we have created a table of content to help you easily navigate through our ultimate WordPress SEO guide.

Table of Contents

Introduction

The Basics of WordPress SEO

The Best WordPress SEO Plugin

WordPress SEO Best Practices

Speed and Security for WordPress SEO

Finally, see more SEO tools and resources to take your WordPress SEO even farther.

Introduction

We know the idea of optimizing for WordPress SEO can be intimidating for beginners, especially if you’re not not a tech geek.

But don’t worry — it doesn’t have to be complicated. Start here to learn the basics, and then you can start applying them to your own website.

What is SEO?

What is SEO?

SEO is an acronym that stands for Search Engine Optimization. It’s a strategy used by website owners to get more traffic by ranking higher in search engines.

Search engine optimization isn’t about tricking Google or gaming the system. It’s simply about creating a website that has optimized code and formatting which makes it easy for search engines to find your website.

When people search the web for the topics you write about, your search-engine-optimized content will appear higher in the search results, and you’ll get more people clicking through to your website.

[Back to top ↑]

Why SEO is important

Search engines are often the biggest source of traffic for most websites.

Google and other search engines use advanced algorithms to understand and rank pages appropriately in search results. But those algorithms aren’t perfect — they still need your help to understand what your content is about.

If your content isn’t optimized, then search engines won’t know how to rank it. When people search for the topics you write about, your website won’t appear in the search results, and you’ll miss out on all that traffic.

It is really important for all business owners to make their website search engine friendly, so that they can maximize their search traffic.

[Back to top ↑]

Basics of WordPress SEO

SEO can get technical, but it doesn’t have to be. Just learning a few basic SEO tips to optimize your site can give you a noticeable boost in your website traffic.

You don’t have to be a tech genius to use the techniques below. If you’re already using WordPress, then you’ve got what it takes!

Let’s get started optimizing your website.

Check Your Site’s Visibility Settings

WordPress comes with a built-in option to hide your website from search engines. The purpose of this option is to give you time to work on your website before it’s ready to go public.

However, sometimes this option can get checked accidentally and it makes your website unavailable to search engines.

If your website is not appearing in search results, then the first thing you need to do is to make sure that this option is unchecked.

Simply log in to the admin area of your WordPress site and visit Settings » Reading page.

Search engine visibility settings in WordPress

You need to scroll down to the ‘Search Engine Visibility’ section and make sure that the box next to ‘Discourage search engines from indexing this site’ is unchecked.

Don’t forget to click on the ‘Save Changes’ button to store your changes.

[Back to top ↑]

SEO friendly URLs contain words that clearly explain the content of the page, and they’re easy to read by both humans and search engines.

Some examples of SEO friendly URLs are:

http://www.wpbeginner.com/how-to-install-wordpress/
http://www.wpbeginner.com/common-wordpress-errors-and-how-to-fix-them/

Notice that these URLs are readable and a user can guess what they will see on the page just by looking at the URL text.

So what does a non-SEO friendly URL look like?

http://www.wpbeginner.com/?p=10467
http://example.com/archives/123

Notice that these URLs use numbers unrelated to the content, and a user cannot guess what they will find on the page by looking at the URL.

Using SEO friendly permalink structure improves your chances of getting better positions in search results.

Here is how you can check and update your WordPress site’s permalink structure.

You need to visit the Settings » Permalinks page. Select the post name option and then click on the ‘Save Changes’ button to store your settings.

SEO friendly URL structure in WordPress

For more detailed instructions take a look at our guide on what is a SEO friendly URL structure in WordPress.

Note: If your website has been running for more than 6 months, then please don’t change your permalink structure unless you’re using the numbers option. If you’re using Day and Name or Month and Name, continue using that.

By changing your permalink structure on an established site, you will lose all of your social media share count and run the risk of losing your existing SEO ranking.

If you must change your permalink structure, then hire a professional, so they can setup proper redirects. You’ll still lose your social share counts on the pages.

[Back to top ↑]

WWW vs non-WWW

If you are just starting out with your website, then you need to choose whether you want to use www (http://www.example.com) or non-www (http://example.com) in your site’s URL.

Search engines consider these to be two different websites, so this means you need to choose one and stick to it.

You can set your preference by visiting the Settings » General page. Add your preferred URL in both the ‘WordPress Address’ and ‘Site Address’ fields.

Non-www or www in WordPress URLs

Despite what someone else might say, from a SEO standpoint there’s no advantage to using one or another.

For more detailed information on this topic, take a look at our guide on www vs non-www – which is better for WordPress SEO.

[Back to top ↑]

The Best WordPress SEO plugin

One of the best part about WordPress is that there’s a plugin for everything, and SEO is no exception. There are thousands of WordPress SEO plugins which makes it harder for beginners to choose the best WordPress SEO plugin.

Instead of installing separate plugins for individual SEO tasks, we will help you choose the best WordPress SEO plugin that does it all, and it’s 100% free.

Choosing the Best WordPress SEO Plugin

Choosing the best WordPress SEO plugin

When it comes to choosing the best WordPress SEO plugin, you will most likely narrow your choices down to the two most popular solutions: Yoast SEO or All in One SEO Pack.

They are both effective solutions, and we’ve done a pros and cons comparison of Yoast SEO vs All in One SEO Pack.

At WPBeginner, we use Yoast SEO, so in this tutorial we’ll be using Yoast SEO for screenshots and examples.

Regardless, we have a step by step guide on properly setting up each of these plugins:

[Back to top ↑]

Add XML Sitemaps in WordPress

xml sitemap

An XML Sitemap is a specially formatted file that lists every single page on your website. This makes it easy for search engines to find all of your content.

While adding an XML sitemap does not boost your site’s search rankings, it does help search engines find the pages quickly and start ranking them.

If you’re using the Yoast SEO plugin, then it will automatically create an XML sitemap for you. To find your sitemap, just go to this URL (don’t forget to replace example.com with your own domain name):

http://example.com/sitemap_index.xml

We will show you how to submit your XML sitemap to Google in the next step.

[Back to top ↑]

Add Your Site to Google Search Console

Google Search Console

Google Search Console also known as Webmaster Tools is a set of tools offered by Google to give website owners a look at how their content is seen by the search engine.

It provides reports and data to help you understand how your pages appear in search results. You also get to see the actual search terms people are using to find your website, how each page appears in the search results, and how often your pages are clicked.

All this information helps you understand what’s working on your site and what’s not. You can then plan your content strategy accordingly.

Google Search Console also alerts you when there is something wrong with your website, like when search crawlers are unable to access it, find duplicate content, or restricted resources.

We have a step by step guide on how to add your WordPress site to Google Search Console.

If you’re using Yoast SEO, then follow step 11 in our Yoast SEO setup guide.

If you’re not using Yoast SEO, then you can watch our video that shows an alternative way:

Once you have added your website to Google Search Console, click on the Crawl menu and then select Sitemaps.

Crawl section in Google Search Console

After that you need to click on the Add Sitemap button.

Adding your wordpress xml sitemap in Google webmaster tools

Your main sitemap is sitemap_index.xml so go ahead and submit that.

Once you have successfully added your sitemap, it will appear as pending. It does take Google some time to crawl your website. After a few hours, you would be able to see some stats about your sitemap. It will show you the number of links it found in your sitemap, how many of them got indexed, a ratio of images and web pages, etc.

We recommend that you check your Search Console at least on a monthly basis for gathering insights and see your website’s SEO progress.

[Back to top ↑]

Optimizing Your Blog Posts for SEO

Often beginners make the mistake of thinking that installing and activating a WordPress SEO plugin is all what’s needed. SEO is an ongoing process that you must keep up with if you want to see maximum results.

Yoast SEO allows you to add a title, description, and focus keyword to to every blog post and page. It also shows you a preview of what users will see when they Google your website.

We recommend that you optimize your title and description to get maximum clicks.

When writing your blog post, simply scroll down to the Yoast SEO section and take full advantage of it.

Yoast SEO meta box

If you’re wondering how to choose a focus keyword, what is a good title, or what is a good meta description, then we have covered it in details in our beginners guide to optimize your blog posts for SEO.

We highly recommend that you read it because on-page SEO is crucial for your success.

[Back to top ↑]

WordPress SEO Best Practices

If you follow the basics of WordPress SEO and use the best WordPress SEO plugin, you will already be ahead of most websites.

However if you want even better results, then you need to follow the WordPress SEO best practices below.

These aren’t too technical and most won’t even require you to touch any code. But they will make a big difference if you follow them.

Properly Using Categories and Tags in WordPress

Category and tags

WordPress allows you to sort your blog posts into categories and tags. This makes it easy for you to manage your content by topics, and for your users to find the content they’re looking for.

Categories and tags also help search engines understand your website structure and content.

Often beginners get confused on how to best use categories and tags. After explaining this to thousands of readers, here’s how we approach categories and tags.

Categories are meant for broad grouping of your posts. If your blog was a book, then categories will be the table of content.

For example, on a personal blog you can have categories like music, food, travel, etc. Categories are hierarchical, so you can add child categories to them.

On the other hand, tags are more specific keywords that describe the contents of an individual post. For example, a blog post filed under food category can have tags like salad, breakfast, pancakes, etc. Think of these as indexes section in a text book.

For more on this topic, see our guide on categories vs tags and SEO best practices for sorting your content.

By using categories and tags properly, you make it easy for your users to browse your website. Since it’s easy for users, it also makes it easier for search engines to browse your website.

[Back to top ↑]

Make Internal Linking a Habit

Internal linking in WordPress

Search engines assign each page on your website a score (page authority). The recipe of this score is kept secret so that people cannot game the results. However, the most common signals of authority are links.

This is why it’s important that you link to your own content from your other blog posts and pages.

You should make it a habit to interlink your own posts whenever possible. If you have multiple authors, then create a pre-publish blog post checklist that requires them to interlink at least 3 other blog posts.

This will help you boost your pageviews, increases the time users spend on your site, and ultimately will improve the SEO score of your individual blog posts and pages.

[Back to top ↑]

Optimize WordPress Comments

Optimize WordPress comments

Comments can be a strong indication of user engagement on your website. Engaged users means more links back to your site, more traffic, and improved SEO.

But you need to make sure that your comments are real and not spam. Spammers submit comments with bad links which could affect and even ruin your search rankings.

This is why we recommend everyone to start using Akismet. It is one of the two plugins that come pre-installed with every WordPress site, and it helps you combat comment spam.

If Akismet alone is unable to handle comment spam, then see these tips and tools to combat comment spam in WordPress.

If your blog posts attract a lot of genuine, spam-free comments, then you should pat yourself on the shoulder for building such an engaging website!

However, too many comments on a post can make it load slower which also affects your search engine rankings. (Keep reading below to find out more about how speed affects SEO.)

To prepare your website so that it can handle the burden your comments put on your server and speed, you can split comments into multiple pages. See our tutorial on how to paginate comments in WordPress.

(If you’d like to get more comments on your site, check out these 11 ways to get more comments on your WordPress blog posts.)

[Back to top ↑]

NoFollow External Links in WordPress

NoFollow external links

As mentioned above, links help search engines decide which pages are important. When you link to a website, you are passing some of your site’s SEO score to that link. This SEO score is called “link juice.”

For good search rankings you need to make sure that you are getting more link juice from other websites than you are giving away.

Adding the “nofollow” attribute to external links (links to websites that you don’t own) instructs search engines not to follow those links. This helps you save link juice.

A normal external link looks like this in HTML:

<a href="http://example.com">Example Website</a>

An external link with the nofollow attribute looks like this:

<a href="http://example.com" rel="nofollow">Example Website</a>

You can also add rel=”nofollow” checkbox to the insert link popup. This will allow you to easily add nofollow to external links.

[Back to top ↑]

Full Posts vs Summaries or Excerpts

Full posts vs summary or excerpts

WordPress displays and links to your posts from a number of pages like home page, category archive, tags archive, date archive, author pages, etc.

By default, it shows the full article content on all these pages. This affects your site’s SEO, as search engines may find it to be duplicate content. Full articles also make your archive pages load slower.

Showing full articles everywhere also affects your page views. For example, users who subscribe to your RSS feed will be able to read the full article in their feed reader without ever visiting your website.

The easiest way to solve this is by showing summaries or excerpts instead of full articles.

You can do this by going to Settings » Reading and select summary.

For detailed instructions, see our guide on how to customize WordPress excerpts without coding.

[Back to top ↑]

Speed and Security for WordPress SEO

Even if you follow all the WordPress SEO tips and best practices above, if your site is slow or gets taken down by a hacker, your search engine rankings will take a big hit.

Here’s how to prevent your site from losing search engine traffic due to slow performance or lax security.

Optimize Your Site’s Speed and Performance

Optimize your WordPress site's speed and performance

Research shows that in the internet age, the average human attention span is shorter than that of a goldfish.

Web usability experts believe that users decide whether they want to stay or leave within few seconds of visiting a website.

That means that as a website owner, you only have a few seconds to present your content and engage users. You don’t want to waste this precious time making your visitor wait for your website to load. Search engines like Google admit that they rank faster websites higher than slow loading websites.

If you need to improve your site’s speed, check out this expert advice on 18 useful tricks to speed up WordPress and boost performance.

[Back to top ↑]

Optimizing Images in WordPress for SEO

Images are more engaging than text but they also take more time to load. If you are not careful with image sizes and quality, then they can slow down your website.

You need to make sure that you use images that are optimized to load faster. See our guide on how to speed up WordPress by optimizing images for the web.

Another trick you can use to optimize your images for search engines is to use descriptive title and alt tags. These tags help search engines understand what your image is about. They also help users with visual impairment as their screen readers can read the alt and title tags to them.

WordPress allows you to add title and alt tags when you upload an image.

Add alt and title tags to your images in WordPress

If you are a photographer or add a lot of images to your WordPress site, then you need to use a gallery plugin.

We recommend using Envira Gallery. In our speed tests, we found it to be the fastest WordPress gallery plugin. It’s also fully responsive and SEO friendly out of the box.

[Back to top ↑]

Security and Safety of Your WordPress Site

WordPress security

Each week, Google blacklists around 20,000 websites for malware and around 50,000 for phishing. When a site is blacklisted, it doesn’t show up in any search results at all.

This means that the security of your WordPress site is crucial for good rankings. You don’t want all your hard work on SEO to go to waste if your site is compromised by a hacker.

The good news is that it’s not that difficult to keep your WordPress site safe — see the step by step instructions in our ultimate WordPress security guide.

At WPBeginner, we use Sucuri to protect our website against attacks. To see why we recommend this service, check out our case study of how Sucuri helped us block 450,000 WordPress attacks in 3 months.

[Back to top ↑]

Start Using SSL/HTTPS

A site secured by SSL and HTTPS

SSL (Secure Sockets Layer) is a technology that encrypts the connection between a user’s browser and the server they are connecting to. This adds an additional security layer to your WordPress site.

Websites secured with SSL are indicated by a padlock sign in the browser’s address bar. This makes your website more trustworthy, and it is required if you are running an online store with WordPress and processing sensitive payment information.

If you are using Bluehost, then you can purchase a SSL certificate. If you’re going to purchase your SSL certificate through your web hosting company, see our guide on how to add SSL and HTTPS in WordPress.

You can also get free SSL with Let’s Encrypt. Several WordPress hosting companies like Siteground, Dreamhost, and WPEngine have already started offering easy Let’s Encrypt integrations.

For step by step instructions, see our guide on how to add free SSL in WordPress with Let’s Encrypt.

[Back to top ↑]

More SEO Tools and Resources

Once you get the hang of WordPress SEO best practices, you’ll want to take your skills even further to get ahead of your competition.

We have compiled a list of best WordPress SEO plugins and tools that you should use to boost your SEO. If you’re ready to try some more advanced techniques, you can also check out our archive of WordPress SEO articles.

[Back to top ↑]

We hope this article helped you learn how to properly optimize your WordPress site for SEO. Go ahead and implement a few of these WordPress SEO tips, and you should see an increase in your traffic within a few months as the search engines process your changes.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post Ultimate WordPress SEO Guide for Beginners (Step by Step) appeared first on WPBeginner.

How to Optimize Your WordPress Robots.txt for SEO

Do you want to optimize your WordPress robots.txt file? Not sure why and how robots.txt file is important for your SEO? We have got you covered. In this article, we will show you how to optimize your WordPress robots.txt for SEO and help you understand… Read More »

To leave a comment please visit How to Optimize Your WordPress Robots.txt for SEO on WPBeginner.

Do you want to optimize your WordPress robots.txt file? Not sure why and how robots.txt file is important for your SEO? We have got you covered. In this article, we will show you how to optimize your WordPress robots.txt for SEO and help you understand the importance of robots.txt file.

Recently, a user asked us if they need a robots.txt file and what is the importance of it? Your site’s robots.txt file play an important role in your site’s overall SEO performance. It basically allows you to communicate with search engines and let them know which parts of your site they should index.

Understanding robots.txt  importance in WordPress SEO

Do I Really Need a Robots.txt File?

Absence of a robots.txt file will not stop search engines from crawling and indexing your website. However, it is highly recommended that you create one. If you want to submit your site’s XML sitemap to search engines, then this is where search engines will look for your XML sitemap unless you have specified it in Google Webmaster Tools.

We highly recommend that if you do not have a robots.txt file on your site, then you immediately create one.

Where is the Robots.txt file? How to Create a Robots.txt file?

Robots.txt file usually resides in your site’s root folder. You will need to connect to your site using an FTP client or by using cPanel file manager to view it.

It is just like any ordinary text file, and you can open it with a plain text editor like Notepad.

If you do not have a robots.txt file in your site’s root directory, then you can always create one. All you need to do is create a new text file on your computer and save it as robots.txt. Next, simply upload it to your site’s root folder.

How to Use Robots.txt file?

The format for robots.txt file is actually quite simple. The first line usually names a user agent. The user agent is actually the name of the search bot you are trying to communicate with. For example, Googlebot or Bingbot. You can use asterisk * to instruct all bots.

The next line follows with Allow or Disallow instructions for search engines, so they know which parts you want them to index, and which ones you don’t want indexed.

See a sample robots.txt file:

User-Agent: *
Allow: /wp-content/uploads/
Disallow: /wp-content/plugins/
Disallow: /readme.html

In this sample robots.txt file for WordPress, we have instructed all bots to index our image upload directory.

In the next two lines we have disallowed them to index our WordPress plugins directory and the readme.html file.

Optimizing Your Robots.txt File for SEO

In the guidelines for webmasters, Google advises webmasters to not use robots.txt file to hide low quality content. If you were thinking about using robots.txt file to stop Google from indexing your category, date, and other archive pages, then that may not be a wise choice.

Remember, the purpose of robots.txt is to instruct bots what to do with the content they crawl on your site. It does not stop bots from crawling your website.

There are other WordPress plugins which allow you to add meta tags like nofollow and noindex in your archive pages. WordPress SEO plugin also allows you to do this. We are not saying that you should have your archive pages deindexed, but if you wanted to do it, then that’s the proper way of doing it.

The proper way of adding noindex to archive pages in WordPress

You do not need to add your WordPress login page, admin directory, or registration page to robots.txt because login and registration pages have noindex tag added as meta tag by WordPress.

It is recommend that you disallow readme.html file in your robots.txt file. This readme file can be used by someone who is trying to figure out which version of WordPress you are using. If this was an individual, then they can easily access the file by simply browsing to it.

On the other hand if someone is running a malicious query to locate WordPress sites using a specific version, then this disallow tag can protect you from those mass attacks.

You can also disallow your WordPress plugin directory. This will strengthen your site’s security if someone is looking for a specific vulnerable plugin to exploit for a mass attack.

Adding Your XML Sitemap to Robots.txt File

If you are using Yoast’s WordPress SEO plugin or some other plugin to generate your XML sitemap, then your plugin will try to automatically add your sitemap related lines into robots.txt file.

However if it fails, then your plugin will show you the link to your XML Sitemaps which you can add to your robots.txt file manually like this:

Sitemap: http://www.example.com/post-sitemap.xml
Sitemap: http://www.example.com/page-sitemap.xml

What Does an Ideal Robots.txt File Should Look Like?

Honestly, many popular blogs use very simple robots.txt files. Their contents vary, depending on the needs of the specific site:

User-agent: *
Disallow:

Sitemap: http://www.example.com/post-sitemap.xml
Sitemap: http://www.example.com/page-sitemap.xml

This robots.txt file simply tells all bots to index all content and provides the links to site’s XML sitemaps.

Here is another example of a robots.txt file, this time it is the one we use here on WPBeginner:

User-Agent: *
Allow: /?display=wide
Allow: /wp-content/uploads/
Disallow: /wp-content/plugins/
Disallow: /readme.html
Disallow: /refer/

Sitemap: http://www.wpbeginner.com/post-sitemap.xml
Sitemap: http://www.wpbeginner.com/page-sitemap.xml
Sitemap: http://www.wpbeginner.com/deals-sitemap.xml
Sitemap: http://www.wpbeginner.com/hosting-sitemap.xml

That’s all. We hope this article helped you learn how to optimize your WordPress robots.txt file for SEO. You may also want to see our guide on 9 Best WordPress SEO plugins and tools that you should use.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

To leave a comment please visit How to Optimize Your WordPress Robots.txt for SEO on WPBeginner.