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:
wp plugin deactivate seo-by-rank-math
Then log in, and reactivate after you adjust the settings below.
%s (e.g., Results for %s).%s matches the values Rank Math injects.Results for %sResults for % (missing the s)Results for %s% (extra % at the end)%s placeholder exactly. A missing or extra % will fatal on PHP 8+.add_filter( 'rank_math/breadcrumbs/search_format', function( $format ) {
// Always include %s for the search query:
return 'Results for %s';
});
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
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.