A physical “robots.txt” file in your site’s root directory will take precedence over Yoast SEO’s virtual “robots.txt”, so the file you created is the one currently being served. This won’t affect Yoast’s XML sitemap generation, as the “robots.txt” file and XML sitemaps are separate features.
Regarding the File Editor, I noticed you added:
“define( ‘DISALLOW_FILE_EDIT’, true );”
This constant actually disables file editing in WordPress. If you want to use the built-in editor (provided your hosting environment allows it), you’ll need to remove that line or set it to “false”.
I generally don’t recommend manually modifying the “robots.txt” file unless it’s absolutely necessary. In most cases, it’s best to let Yoast SEO handle it automatically and use the plugin’s settings to manage your site’s indexability.
I also noticed that you’d like to disallow certain pages. Instead of relying on “robots.txt”, I’d recommend editing those individual pages and setting them to “noindex” in the Yoast SEO settings. This is generally the recommended approach for preventing pages from appearing in search results.
As for the sitemap, you don’t need to edit the XML sitemap directly. Yoast SEO generates it automatically based on your site’s content and settings.
For Google Search Console, you should submit the sitemap index:
The “page-sitemap.xml” URL is simply one of the individual sitemaps referenced by the sitemap index, so there’s no need to submit it separately.
Finally, I recommend checking out my WordPress Website Launch Checklist, which covers Yoast, XML sitemaps, “robots.txt”, and Google Search Console setup:
I hope this helps! Let us know if you have any other questions.
Thanks
Nuhman Nathly
This reply was modified 2 days, 14 hours ago by Nuhman Nathly.
This reply was modified 2 days, 14 hours ago by Nuhman Nathly.