[wp-trac] [WordPress Trac] #43311: Missing full path to Sitemap in virtual robots.txt
WordPress Trac
noreply at wordpress.org
Wed Feb 14 08:55:12 UTC 2018
#43311: Missing full path to Sitemap in virtual robots.txt
------------------------------+-----------------------------
Reporter: kohlermedia | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 4.9.4
Severity: normal | Keywords:
Focuses: coding-standards |
------------------------------+-----------------------------
The function witch generates the virtual robots.txt strips the path
https://mydomain.com/sitemap.xml to /sitemap.xml.
Tested with
add_filter( 'robots_txt', 'robots_mod', 10, 2 );
function robots_mod( $output, $public ) {
$output .= "Sitemap: https://mydomain.com/sitemap.xml/\n";
return $output;
}
in functions.php
sitemaps.org notes
"You can specify the location of the Sitemap using a robots.txt file. To
do this, simply add the following line '''including the full URL to the
sitemap''': Sitemap: http://www.example.com/sitemap.xml"
Google search console marks a sitemap without full path as error.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43311>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list