All Others snippets
Others
A Baseline robots.txt Setup for WordPress
A starting-point robots.txt for a typical WordPress site — it keeps your uploads crawlable, keeps search engines out of the folders and pages that don't need indexing, and points crawlers to your sitemaps.
php
User-Agent: *
Allow: /wp-content/uploads/
Disallow: /wp-content/plugins/
Disallow: /wp-content/themes/
Disallow: /readme.html
Disallow: /?s=
Disallow: /search/
Sitemap: http://www.sitename.com/post-sitemap.xml
Sitemap: http://www.sitename.com/page-sitemap.xml
Setup:
- Create a plain text file named
robots.txt. - Paste the rules above into it.
- Replace the placeholder sitemap URLs with your actual site’s address.
- Upload the file to your site’s root directory (the same folder as
wp-config.php).