Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Sitemap] Entry not added to robots.txt #288

Open
rcnascimento opened this issue Aug 21, 2024 · 1 comment
Open

[Sitemap] Entry not added to robots.txt #288

rcnascimento opened this issue Aug 21, 2024 · 1 comment

Comments

@rcnascimento
Copy link

rcnascimento commented Aug 21, 2024

Describe the bug
The sitemap is enabled but the link is not added after my custom robots.txt content.

To Reproduce
Steps to reproduce the behavior:

  1. Make sure the Sitemap is enabled and working (menu "Sitemap Settings");
  2. Save a custom robots.txt via plugin (menu "General Settings", tab "Edit robots.txt");
  3. Open the generated robots.txt file in browser;
  4. The line with sitemap reference is not there.

Expected behavior
The plugin must auto add the sitemap index reference to the robots.txt. At the end of generated file.

@rcnascimento
Copy link
Author

I have changed this hook callback priority to 10 (the usual) and now the line appears on my robots.txt:

$this->filter( 'robots_txt', 'add_sitemap_directive', 0, 2 );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant