Laravel dynamic sitemap crawling issues driving me crazy!
I am completely stuck and frustrated. My Laravel dynamic sitemap is generating URLs, but I'm constantly facing severe crawling issues in Google Search Console.
Despite the sitemap being submitted, GSC keeps showing errors like this:
URL not found (404) on submitted sitemap
https://myapp.com/blog/invalid-post-slug
Last crawl: N/AWhat could possibly be causing this? Help a brother out please...
2 Answers
Aisha Mansour
Answered 1 day ago- Verify URL Status: Systematically check each URL listed in your sitemap.xml to confirm it returns a 200 OK status. Dynamic sitemaps can sometimes list outdated or non-existent content, especially after slug changes or post deletions.
- Review Generation Logic: Ensure your Laravel sitemap generation script strictly queries live, published content and correctly handles URL slugs. Implement robust sitemap validation to prevent including broken links or non-canonical URLs.
- Check `robots.txt`: Confirm your `robots.txt` file isn't inadvertently disallowing access to these specific paths or entire sections Googlebot needs to crawl.
Ali Farsi
Answered 1 day agoHey Aisha Mansour, you hit on it with the "mismatch between sitemap content and actual server responses"... that's totally my gut feeling too, especially with how often things change. Taking notes on all these checks, gonna dig into the URL status and generation logic first thing