UCDavisLibrary / main-wp-website

1 stars 0 forks source link

Automatic robots.txt generation #69

Closed qjhart closed 1 year ago

qjhart commented 2 years ago

For the production deployment the robots.txt file should be:

User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php

Sitemap: https://library.ucdavis.edu/wp-sitemap.xml

for all other deployments, the file should be:

User-agent: *
Disallow: /

The default management of this via the wordpress management console doesn't seem like a complete solution. It removes the site map, but doesn't explicitly Disallow: indexing.

In the current setup. Developers need to proactively disable indexing in their sites, (eg sandbox and stage) by adding a robots.txt file.

dc exec wordpress bash
# on wordpress
echo -e 'User-agent: *\nDisallow: /' > robots.txt

A better setup would be one of:

spelkey-ucd commented 1 year ago

Deployed main-wp-website@v3.2.0