Within the Google XML Sitemap Plugin options, there is an option to add the sitemap url to the virtual robots.txt.
Pretty Cool, right?! Sure, until you want to EDIT the robots.txt file. Let’s give it a go.
A good place to start is to copy the text that is in the virtual robots.txt file provided when using the plugin mentioned above, paste it into a new file called robots.txt, and then edit the code to your preference. Now upload it to your root directory.
Here’s an example of my robots.txt file:
User-agent: * Disallow: /wp-admin/ Disallow: /wp-includes/ Disallow: /wp-content/plugins/ Disallow: /wp-content/themes/ Sitemap: https://www.websitename.com/sitemap.xml
Once uploaded, this robots.txt file will over-ride the “virtual” one created via the sitemap plugin, meaning that plugin option won’t work anymore. No big deal. Just a heads up. 😉