|
/ 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 stores its XML sitemap as pre-built cache files rather than generating it fresh on every request. This cache is normally rebuilt automatically:

  • Every 6 hours in the background
  • Immediately when your content changes, on sites where scheduled background tasks aren’t running reliably

wp surerank generate_cache triggers that same rebuild on demand, the same process used by the “Regenerate” button in your SureRank dashboard. It walks through every public post type and taxonomy on your site, rebuilds the sitemap files, and doesn’t return control back to you until the rebuild finishes (or fails).

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

The batch process started.

Batch Process Complete!

SureRank Cache generated successfully

When to Use This

  • Your sitemap shows stale content and you don’t want to wait for the next automatic 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.
  • The rebuild is safe to interrupt: your existing sitemap keeps working normally until the new one is fully built, so a failed or interrupted run never leaves you with a broken sitemap.
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