Sitemap not containing all pages

First off, WordPress itself is pretty good about SEO and structure right out of the box, there are countless WordPress websites that rank in the top 10 if not at number one for a given search. There is nothing at all in your OP that would lead me to believe WordPress is the problem. Second … Read more

Unlimited false pages showing in Sitemap?

Same for me. It started around 3th 4th of January 2021 -.- I can’t find a way to remove them. Moreover, when you search my website, it gives out a japanese result (my page is in italian). I really don’t know how to solve it.

Google search console sitemap 404 error

You probably need to “flush” your permalinks. Turn the sitemap feature off, (yaost?), change your permalinks to default and back, turn on the sitemap feature again. I like using a separate plugin to handle this instead of using Yoast. I don’t like their naming convention/structure, and this issue seems to happen a lot.

How to get the URL of a sitemap that contains a certain post?

I achieved it using this simple query <?php $chunks=array_chunk( get_posts([ ‘fields’=>’ids’, ‘posts_per_page’=>-1, ‘post_type’=>[$post->post_type], ‘orderby’=>’ID’, ‘order’=>’ASC’ ]), wp_sitemaps_get_max_urls(‘post’) ); foreach($chunks as $key => $chunk) { if(!in_array($post->ID,$chunk)) continue; var_dump(get_sitemap_url(‘posts’,$post->post_type,$key + 1)); break; }