- Try saving permalinks under
WP Admin > Settings > Permalinks
. Even if a permalink structure is already selected, clicking save rebuilds the system and attempts to write .htaccess
rules to the server if missing.
- Empty caches. This might include host-level caches, WordPress cache plugins, CDNs such as Cloudflare, and browser cache (try a private window).
- If all plugins cannot be disabled temporarily via WP Admin, one can disable plugins for administrators with the below code uploaded to
/wp-content/mu-plugins/links-to-disable-plugins.php
<?php
/**
* Plugin Name: Links to Disable Plugins
* Description: An mu-plugin which will output links to disable one plugin at a time at a test URL on the site if the current user is logged in as an administrator. Shortcode [links_to_disable_plugins]. Delete after use.
*/
define( 'KEY_TO_ALLOW_THIS', 'ChangeThisToSomethingRandom' );
define( 'PATH_TO_TEST', '/books/' );
add_shortcode(
'links_to_disable_plugins',
function( $atts, $tag, $content ) {
if ( ! current_user_can( 'manage_options' ) ) {
return '';
}
ob_start();
echo '<ul>';
foreach( get_option( 'active_plugins' ) as $plugin_path ) {
printf(
'<li><a href="%s">Disable %s</a>',
esc_url(
add_query_arg(
[
'key' => KEY_TO_ALLOW_THIS,
'disable' => $plugin_path,
],
site_url( PATH_TO_TEST )
)
),
$plugin_path
);
}
echo '</ul>';
return ob_get_clean();
}
);
add_filter(
'option_active_plugins',
function( $plugins ) {
if (
array_key_exists( 'key', (array) $_GET )
&& array_key_exists( 'disable', (array) $_GET )
&& KEY_TO_ALLOW_THIS === $_GET['key']
) {
foreach( $plugins as $key => $directory_slash_file ) {
if ( $directory_slash_file === urldecode( $_GET['disable'] ) ) {
flush_rewrite_rules();
unset( $plugins[ $key ] );
break;
}
}
}
return $plugins;
}
);
Where:
- The folder
wp-content/mu-plugins/
should be created if it does not exist.
ChangeThisToSomethingRandom
should be changed to random text only you know.
/books/
is the path on the site you would like to test.
[links_to_disable_plugins]
is a shortcode which will output a list of links to disable one plugin at a time at the test URL, flushing permalink rewrite rules each time. Links will only display if the current user is logged in as an administrator.
- The link will only disable the one plugin for that one page view.
/wp-content/mu-plugins/links-to-disable-plugins.php
should be deleted after use.
If none of those fix it, the Query Monitor plugin has a section to inspect what permalink rules exist, and which rule WordPress matched for a page. There may also be more information about what plugins are running and any known problems under WP Admin > Tools > Site Health > Info