• Hi,

    I am curious, the past couple of times I’ve done a network update it leads to a 404 page error on all sites. If I go to Settings > Permalinks and click save it corrects it. But it’s a bit of a pain to have to go into all sites, is there a way to avoid this error? Not sure why it’s happening, any thoughts/ideas are welcome.

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • It’s flushing the rewrite rules.

    Not sure how to avoid it, no. there is a thread aroudn here where someone had a code snippet to run in mu-plugins to reset the permalinks too. Darn it I need to find it and stick it in my text file…

    Thread Starter danaskallman

    (@dskallman)

    Cool, I’ll look for that. Wasn’t sure what it would be called or what to look for.

    Thanks Andrea!

    You could probably use something like:

    add_action( 'admin_init', 'my_flush_rules' );
    
    function my_flush_rules() {
    global $wp_rewrite;
    $wp_rewrite->flush_rules();
    }

    I’ve never used that code before, so test it on a development area before putting it on your live site.

    Can you tell me, in which file do I need to write the above code?

    In the mu-plugins folder in a .php file.

    Please use the code sparingly! It can adversely impact the performance of your sites and should not be used unless really, really needed. And even then, remember to take the code out after you are done.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘404 Page error on all site after network update’ is closed to new replies.