|
/ Documentation /Developers Documentation/ Regenerating the SureRank Sitemap Cache with WP-CLI

Regenerating the SureRank Sitemap Cache with WP-CLI

Command: wp surerank generate_cache [--force]

What It Does

SureRank builds the sitemap on demand by default. A developer can enable scheduled background prebuilding with the surerank_sitemap_background_generation filter.

  • In the default mode, sitemap requests can build missing or stale cache entries.
  • In background mode, SureRank prebuilds the cache for later requests.

Use wp surerank generate_cache to request a cache rebuild from the command line. In background mode, the dashboard can also show a Regenerate button.

Options

OptionDescription
--forceSkip the check for whether anything changed, and rebuild the sitemap unconditionally.

Without --force, SureRank checks whether your site’s content has changed since the last build. If nothing changed, it exits early:

Checksums match; no data available to sync.

Use --force to rebuild regardless, for example after changing your sitemap inclusion settings, after a bulk import, or when troubleshooting a sitemap that looks stale or broken.

Usage

wp surerank generate_cache            # rebuild only if content changed

wp surerank generate_cache --force    # always rebuild

Example output:

$ wp surerank generate_cache --force

Batch process started.

Batch Process Complete!

SureRank Cache generated successfully

When to Use This

  • The sitemap shows stale output and you want to trigger a manual rebuild.
  • Scheduled background tasks (WP-Cron) are disabled or unreliable on your hosting environment.
  • You’re scripting a rebuild into a deploy, a staging-to-production sync, or a bulk migration.
  • You want a first troubleshooting step for a stale or broken sitemap before contacting support.

Notes

  • Requires WP-CLI access with normal command-line permissions on your site. No separate SureRank permission is needed.
  • On large sites, this command temporarily raises memory limits and removes time limits for the duration of the rebuild, since it runs the whole process immediately rather than in smaller background batches.
  • Avoid interrupting a rebuild. SureRank attempts to preserve the previous cache during regeneration, but fallback depends on filesystem support. If a run fails, rerun it and verify the sitemap index and child files.
Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Need help? Contact Support
Table of Contents
Scroll to Top