How to Fix – Rank Math Fatal: “Missing format specifier at end of string”

If Rank Math throws Fatal error: Uncaught ValueError: Missing format specifier at end of string (often in includes/frontend/class-breadcrumbs.php), the issue is almost always a malformed sprintf() format in your Breadcrumbs text (for example a stray % or a missing %s). Here’s the quick recovery and the permanent fix.

My site crashes with “ValueError: Missing format specifier at end of string” from Rank Math (class-breadcrumbs.php). How do I fix this without disabling the plugin?

This error means a text string Rank Math passes to sprintf() isn’t valid (for example, it ends with a lone % or the number of placeholders doesn’t match). The most common source is a customized Breadcrumbs label. Fix it like this:

Quick recovery

  1. Temporarily disable Rank Math (if you’re locked out):
    wp plugin deactivate seo-by-rank-math

    Then log in, and reactivate after you adjust the settings below.

Permanent fix (Breadcrumbs formats)

  1. Go to WordPress Dashboard → Rank Math SEO → General Settings → Breadcrumbs.
  2. Review every text field that can contain a placeholder (examples vary by version/theme integration):
    • Search Results Format should include %s (e.g., Results for %s).
    • Author Archives Format, Date Archives, 404 label, etc. If they use placeholders, make sure they’re valid (e.g., Articles by %s).
  3. Remove any stray “%” at the end of a string and ensure the number of %s matches the values Rank Math injects.
  4. Click Save, then clear caches (page cache, Rank Math/SEO plugin cache if applicable, and any CDN).
  5. Update Rank Math to the latest version.

Common examples (good vs. bad)

  • Good: Results for %s
  • Bad: Results for % (missing the s)
  • Bad: Results for %s% (extra % at the end)

If you use translations or custom code

  • Translations (WPML/Polylang/Loco): Make sure translated strings preserve the %s placeholder exactly. A missing or extra % will fatal on PHP 8+.
  • Theme overrides / filters: If you customize breadcrumb labels in code, ensure your format string and arguments line up:
    add_filter( 'rank_math/breadcrumbs/search_format', function( $format ) {
        // Always include %s for the search query:
        return 'Results for %s';
    });

Verify the fix

  1. Enable debug logging (temporarily) if needed:
    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );
  2. Reload the page that previously crashed. The fatal should be gone, and breadcrumbs should render normally.

Why this happens on PHP 8+

PHP 8 turned many formatting mistakes into hard ValueError exceptions. If a breadcrumb label contains a malformed % sequence, sprintf() now throws a fatal instead of a notice/warning, hence the crash.


Still seeing the error after fixing Breadcrumbs? Check any plugin/theme strings that filter Rank Math breadcrumbs and ensure their placeholders (%s, etc.) are valid and in the right count.