How do I optimise my robots.txt file within WordPress?
This article will detail how to optimise your robots.txt WordPress file.
What is a robots.txt file?
A robots.txt file is used to inform search engine robots how to crawl your webpages, so that they can grab your content along with its links which, in turn, will help visitors find your site.
You can also use Robots to set which pages search engine robots should NOT crawl and prevent specific robots from crawling your site at all.
Where can I find my Robots file?
Your WordPress robots.txt file can be found within your website’s files after you’ve connected to your site via FTP.
From there, you can manually edit your file to set which robots can crawl your pages, along with the pages they should and shouldn’t crawl. Details on how to do this can be seen in the section below.
How do I add/optimise my Robots file?
You can optimise your Robots file via a plugin or via FTP, both of which are outlined below.
Via a plugin
If you’re not particularly tech-savvy, then you can install a plugin in WordPress to allow Robots. To do this, simply follow the instructions outlined below:
From there, hover your cursor over All in One SEO in the left-hand menu and select Tools from the menu that appears.
On the next page, you’ll be shown the Robots.txt Editor. Simply toggle the option for Enable Custom Robots.txt to enable Robots.
From here, you can add your own rules by entering values into the provided text boxes:
- User Agent: which bots you wish to target. If you want to target ALL bots, simply enter *
- Rule: set whether you want to Allow or Disallow the rule
- Directory Path: set where your rule should be set
Once you’re happy, click Add Rule to insert your rule, followed by Save Changes.
Via FTP
Start by opening FileZilla.
Right-click your robots.txt file and select View/Edit.
This will open a Notepad file where you can begin adding/editing your rules.
- User Agent: which bots you wish to target. If you want to target ALL bots, simply enter *
- Disallow: which pages on your site you want robots to avoid
Be sure to save your Notepad file after you’ve made any changes.