Title: Sitemap is locked
Last modified: May 7, 2026

---

# Sitemap is locked

 *  Resolved [shaunbowen](https://wordpress.org/support/users/shaunbowen/)
 * (@shaunbowen)
 * [3 days, 18 hours ago](https://wordpress.org/support/topic/sitemap-is-locked/)
 * Hi there, for some reason the sitemap generated by The SEO Framework on one of
   my sites is empty.
 * If I refresh the cache it says “Sitemap is locked for XXX seconds. Please try
   again later”.
 * If I wait for XXX seconds, it then just loads the empty sitemap again.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fsitemap-is-locked%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [shaunbowen](https://wordpress.org/support/users/shaunbowen/)
 * (@shaunbowen)
 * [3 days, 17 hours ago](https://wordpress.org/support/topic/sitemap-is-locked/#post-18901939)
 * I have figured out the culprit.
 * I have a default script added to my functions.php to prevent certain pages from
   being added to the sitemap:
 *     ```wp-block-code
       add_filter(	'the_seo_framework_sitemap_exclude_ids',	function( $ids ) {		$lp_parent_ids = get_posts( [			'post_type' => 'landing_page',			'fields'    => 'ids',			'post_parent' => 0,		] );		//$my_exclude_ids = get_posts( [		//	'post_type' => 'post',		//	'fields'    => 'ids',		//	'category' => 9		//] );		return array_merge( $ids, $lp_parent_ids, $my_exclude_ids );	});
       ```
   
 * However, the return was throwing an error when $my_exclude_ids is empty (as I
   commented out the code above it).
 * I will mark this as resolved.
 *  Plugin Author [Sybre Waaijer](https://wordpress.org/support/users/cybr/)
 * (@cybr)
 * [2 days, 21 hours ago](https://wordpress.org/support/topic/sitemap-is-locked/#post-18902798)
 * I’m glad you found the cause!
 * Some backstory: the sitemap sets a lock when it’s building a cached copy. This
   prevents it from becoming a denial-of-service attack vector. The lock is released
   once the sitemap is built, but it cannot be released if the process crashes. 
   The lock is automatically released after 180 seconds or PHP’s max execution time(
   whichever is smaller).
 * In any case, if you don’t want the `landing_page` post type to appear in the 
   sitemap, don’t you also want it to be unindexable? It might then be easier to
   apply “noindex” to the post type; this will also remove the posts from the sitemap.
 *  Thread Starter [shaunbowen](https://wordpress.org/support/users/shaunbowen/)
 * (@shaunbowen)
 * [2 days, 19 hours ago](https://wordpress.org/support/topic/sitemap-is-locked/#post-18902947)
 * Hi [@cybr](https://wordpress.org/support/users/cybr/) thanks for the explanation.
 * Regarding the Landing Pages – I generally only want the top level ones hidden
   from the sitemap, but the children to still be visible, hence the code.
 * I actually manually mark each top-level Landing Page as noindex too.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fsitemap-is-locked%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/autodescription/assets/icon.svg?rev=3000376)
 * [The SEO Framework – Fast, Automated, Effortless.](https://wordpress.org/plugins/autodescription/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autodescription/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autodescription/)
 * [Active Topics](https://wordpress.org/support/plugin/autodescription/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autodescription/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autodescription/reviews/)

## Tags

 * [sitemap](https://wordpress.org/support/topic-tag/sitemap/)

 * 3 replies
 * 2 participants
 * Last reply from: [shaunbowen](https://wordpress.org/support/users/shaunbowen/)
 * Last activity: [2 days, 19 hours ago](https://wordpress.org/support/topic/sitemap-is-locked/#post-18902947)
 * Status: resolved