How To Optimize WordPress Robots.txt For Batter SEO

Maybe you have a WordPress Website and want to rank your website fast? Then WordPress Robots.txt file can help you to rank your site batter and fast. If you don’t know how to create a WordPress Website then See our Guide.

Robots.txt file is a powerful tool that helps you to do batter SEO of your website. Robots.txt file allows the search engine which pages have to crawl and which page should not crawl of your website pages.

Optimize WordPress Robots.Txt

Here I will try to explain how you should use WordPress Robots.txt file to your website and how to create Robots.txt file to do batter SEO fo your website.

What Is WordPress Robots.txt File?

Robots.txt file is a text file that is stored in the website root file. It tells the search engine which page index in search engine and which is not.

There are many misunderstandings of indexing and no indexing website content in Robots.txt file I will look into the aspect too.

Website SEO consists of hundreds of elements and one of the most important is Robots.txt file. This small file helps serious optimizations of your website to stand out on page one.

How To Optimize WordPress Robots.Txt

Many webmasters avoid creating and edit the Robots.txt due to a lack of knowledge. To create and edit this file is so easy just like drinking a glass of water even if you are new after reading the full post.

Best Practice Of Robots.Txt File

Here is Basic WordPress Robots.txt file example bellow

User-agent: [user-agent name]
Disallow: [URL string not to be crawled]
 
User-agent: [user-agent name]
Allow: [URL string to be crawled]
 
 
Sitemap: [URL of your XML Sitemap]

You can have multiple lines of instructions to allow or disallow the search engine to crawl your website.

Disallow: [URL string not to be crawled] means which URL not to be index. In the Disallow section, you have to put these URL which you don’t come in the search result.

Allow: [URL string to be crawled] please enter your site map to index all of your pre set URL. You can simply use Yoast SEO Or Rank Math to create your website site map.

I previously told that anyone can add multiple codes to allow search engines and you can add multiple sitemaps to crawl search engines. If you don’t have any Robots.txt file then search engine crawl all your website and index all your page.

User-Agent: *
Allow: /wp-content/uploads/
Disallow: /wp-content/plugins/
Disallow: /wp-admin/
 
Sitemap: https://yoursite.com/sitemap_index.xml

Here in the above example, you can simply see that I allow the search engine to crawl WordPress upload file and then disallow WordPress Plugins file and also disallow WordPress admin sections. I allow the search engine to crawl the whole site map to index.

Why You Need WordPress Robots.txt File For Your WordPress Site?

If your WordPress Site doesn’t have Robots.txt file then the search engine will still crawl your whole site. But you don’t tell the search engine that which page has to crawl and which page not.

If you start your blog right now then it will not affect your site if don’t have Robots.txt file but if your site has a huge content then it may affect.

For example, your site has more than 1000 posts then some times search engine bot’s not complete full scan your whole site then bot’s complete the remaining session scan in the next session. In this case, your site post will delay to index in search results.

If you set which page has to scan and which has not then search bot’s complete the full scan of your site and rank your site faster. So it will be a good decision to set robots.txt file.

Another good reason to set WordPress Robots.txt file is supposed a page you don’t want to index in search results if you did not set this then bot’s will crawl this page and index the page.

How Robots.txt File Looks Like

A maximum popular blog uses simple Robbots.txt file to index their file and pages. Every site content may vary to index their post according to their needs. So every webmaster set their robots.txt file to index their page according to their needs.

User-agent: *
Disallow:
  
Sitemap: https://www.yoursite.com/post-sitemap.xml
Sitemap: https://www.yoursite.com/page-sitemap.xml
sitemap: https://www.yoursite.com/image-sitemap.xml

Robots.txt file allows the bots to crawl the above site map. The above example clearly mentions that crawl all posts, all pages, and all site images from the XML site maps.

For WordPress site, you can simply add the bellow WordPress Robots.txt file to crawl your WordPress Website and index.

User-Agent: *
Allow: /wp-content/uploads/
Disallow: /wp-content/plugins/
Disallow: /wp-admin/
Disallow: /readme.html
Disallow: /refer/
 
Sitemap: http://www.example.com/post-sitemap.xml
Sitemap: http://www.example.com/page-sitemap.xml
sitemap: https://www.yoursite.com/image-sitemap.xml

In this WordPress Robots.txt file, I just allow WordPress upload folder where it can be a photo, image or any file. In the second line just disallow WordPress plugins file and also disallow WordPress admin panel and readme, refer sections.

The next paragraph allows all site post, all pages, all image which is used in the post. By adding Robots.txt file it tells the google bots which page, post need to index.

Now you understand what is Robots.txt file. So, try to create Robots.txt file for your site or blog.

How To Find Your Site Robots.txt File

Before going to create Robots.txt file for your site you have to confirm that your site already has robots.txt file or not. How can you know that your site has Robots.txt file or not?

How To Find Your Site Robots.Txt File

If you want to know robots.txt file then type your site name in the browser address bar then give / then write Robots.txt then enter you will find the robots.txt file of your website or blog.

https://www.yoursite.com/robots.txt

How To Create WordPress Robots.txt File

If you don’t have Robots.txt file into your website, then you can create a robots.txt file for your site or you can edit your file according to your site needs. In these sections, I will discuss how to create a Robots.txt file for your site.

You can easily create robots.txt file by 4 methods. You want to create the file for your WordPress site by using some simple plugins.

Create Robots.txt File Using Yoast SEO Plugins

Yoast SEO plugins are a great and most popular WordPress plugin on the web. If you don’t have this plugin then install this plugin to do batter SEO of your post and page. If you don’t know how to setup Yoast SEO plugins then check the guide.

This SEO plugin helps you a lot to do SEO and create the sitemap, Robots.txt file and more. Here we try to know How to create Robots.txt file using Yoast SEO.

Create Robots.txt File Using Yoast SEO Plugins

After Install Yoast Plugin go-to SEO sections then click on Tools then you can see this page. After finding this page click on file editor options. A new page will be open where you find create or edit robots.txt file just like bellow.

Create WordPress Robots.txt File Using Yoast Plugins

After Click on the create robots.txt file, a new window will open. After that, you can add or edit robots.txt file according to your needs.

All in One SEO Pack Plugin Helps You To Create Robots.txt File

All in one SEO is a very good WordPress SEO plugins which will help you do good SEO and also help you to create an XML site map, Robots.txt file, and more options.

After successfully install this plugin go to features manager of this admin panel of your plugins. In those sections, you will find robots.txt sections where you can create or edit Robots.txt file.

Robots.txt file create using all in one seo

After clicking on the robots.txt section a new window will open where you can create or edit your site robots.txt file.

Create WordPress Robots.txt file Using Rank Math SEO Plugins

Rank Math SEO is one of the best WordPress SEO plugins which also help the webmaster to rank batter of your blog. In the Rank math plugin, you can create or edit Robots.txt file from your Wp-admin panel.

Create WordPress Robots.txt file Using Rank Math

After successfully install Rank Math plugins click on Rank Math then click on General Setting options Where you will find Robots.txt file editor.

Edit WordPress Robots.txt Sections

After clicking on Edit robots.txt options you can easily create or edit robots.txt options according to your needs.

Create And Upload Robots.txt File Using FTP Account

IF you don’t want to use any WordPress plugins then you can upload your robots.txt file using your FTP account.

To create Robots.txt file just create a text file and add the simple code to your text file (Code is given above) and rename the file as robots.txt and upload the file to the roots of your web server through your FTP account.

How To Test Your Robots.txt File

After successfully create WordPress Robots.txt file it is very clever thoughts to check your robots.txt file for your blog.

To check your robots.txt file you simply go to google search console to test any error. You can simply check your WordPress robots.txt file from the search console. In the search, console find the Robots.txt file sections. Click on the robots.txt file and check the file is correct or you can add your extra file from here.

Conclusion

If you want to increase your search results then you have to index your most important page and post first. A well configures Robots.txt file may help you to increase your search and indexing first.

If you do not index your site post first then you will not stand out in the competition. So here I try to discuss the all necessary details about WordPress Robots.txt file.

What do you think about Robots.txt file? It should need to create or ignore it? What are your opinions please write in the comment box bellow.

Leave a Comment