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.

html sitemap via recursive function

The “memory exhausted” error in question happened because of this part in your function: ‘parent’ => $next_page -> post_parent, which should actually be ‘parent’ => $next_page -> ID (or I’d omit the unnecessary spaces, i.e. I’d use ‘parent’ => $next_page->ID). And the error can be illustrated like so: $cur_page = get_post( 123 ); // assume … Read more

Exclude a specific page from WordPress sitemap. (wp-sitemap.xml)

The code below does work, just make sure you are editing the correct themes function.php file! // Remove specific pages function gt_disable_sitemap_specific_page($args, $post_type) { if (‘page’ !== $post_type) return $args; $args[‘post__not_in’] = isset($args[‘post__not_in’]) ? $args[‘post__not_in’] : array(); $args[‘post__not_in’][] = 221; //locations $args[‘post__not_in’][] = 261; //blog return $args; } add_filter(‘wp_sitemaps_posts_query_args’, ‘gt_disable_sitemap_specific_page’, 10, 2);