• Hi there!

    I’d like to run something by the WordPress and multi-site experts here to see if a possible solution I found for this vexing problem is sound.

    Bit of background first: I am in the last stages of finishing a largish WordPress multisite project (artists-painters association) that includes one main site (lots of pages+posts) and 42 “subsites” which are all branded the same way (same theme + settings) and have the same page and menu structure. The home page of each site is a static page and not the blog.

    The only things users can modify/add is the content in the 2 existing pages, posts of course and image galleries using the NextGen plugin. Their capabilities in their own sites is quite severely limited using Justin Tadlock’s Members plugin.

    Now, the problem I’ve been running into is permalinks getting corrupted over time which causes the links to blog posts to 404. I’m not sure what I do to cause the issue but the last time it happened I had just added a new site to the network. Soon after doing that I realized that all the permalinks in the entire network stopped working and links to blog posts 404’ed. This is nothing when you just have one site but with over 40 sites (and growing) on the network, having to go to each site’s admin and re-save the permalinks (without changes) to fix it is a royal pain.

    After researching the issue I can say that the problem is not related to the .htaccess file and the actual “permalink_structure” option in each site’s wp_00_options table has not changed. So I after reading something I came across Googling the issue, I came to look at the “rewrite_rules” option (serialized) in the same table. You see, I run a local version of that entire multisite network locally to test stuff (plugins, settings changes, etc) and when I backup the live site and restore it locally, permalinks are of course broken. I then found that the one difference I could see between the live site’s settings where permalinks worked and the local one is the “rewrite_rules” option value.

    So I did a test using a plugin called “YD Network-wide Options”

    https://www.ads-software.com/extend/plugins/yd-wpmu-sitewide-options/

    I fixed the permalinks on the template site I use and pushed its “rewrite_rules” option value to all the other sites on the network using the above plugin. Takes about 3 seconds and, after testing 5 or 6 sites where permalinks were broken, they are all working again with no immediately visible ill effects.

    So, my questions are: Does this fix seem sound to you and do you think it may break something else? Do you think it works only because all those sites have the same structure or are the settings in “rewrite_rules” general and not dependent on site structure?

    Permalinks are working on the live site now but I’d really like to hear some of your opinion on this “fix” before I try it on the live site when permalinks break there.

    Thanks very much for reading this entire post but, if this fix works I’ll save a ton of time and I’m quite excited about it ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • I’m not sure what I do to cause the issue but the last time it happened I had just added a new site to the network. Soon after doing that I realized that all the permalinks in the entire network stopped working and links to blog posts 404’ed.

    I’m pretty sure this was a bug that has been fixed.

    Thread Starter pixelyzed

    (@pixelyzed)

    Yes, I did find the bug report after I posted. But regardless of what triggers the issue, I’d like to know if you or anyone else thinks the fix I found can break other things I didn’t notice yet or if it’s pretty safe to do? In the meantime I’ll try to figure out what I may be doing that causes the permalinks to stop working.

    Thanks Andrea! Btw, your presentation at WordCamp Montreal last summer was awesome!

    Oh hey, were you there??? ??

    Yeah, that was because the rewrite rules are flushed. that’s all it affects.

    Thread Starter pixelyzed

    (@pixelyzed)

    Yeah I was there! ??

    I was just wondering because, I read a bit about that field and some people have issues with it becoming bloated and stuff (not my problem here) but I gather it controls links to attachments and other things which would be different between the sites on my network, even if their page structure is the same. It seems that the content of that field varies greatly across different setups and I didn’t want to break something that is not immediately visible by pushing the value of this field from one site to all the others. But I’ve seen no ill effect so far and I guess that, at worst, I can go through each site again and save permalinks the old fashioned way if something breaks when I do my “fix” on the live site.

    Thanks very much for your help!

    If each site has the same permalink structure you should be good.

    Am I gonna see you there this summer too? If so, can’t wait. We are SO going to be there. ?? make sure you say hi.

    (I can;t remember if we spoke or not. :-/)

    Thread Starter pixelyzed

    (@pixelyzed)

    Yep! I’ll certainly be there next summer. WordPress is taking more and more place in my business and I LOVED WordCamp Montreal last summer.

    I’ll say hi for sure and, no I don’t believe we spoke after your presentation although I might have asked a question or 2 during it as I was in the earliest stages of planning this multisite project then and it was my first multisite.

    Have not looked much into WP 3.1 yet and I guess the focus will be on the new stuff in there next summer. Can’t wait!!

    Thanks again Andrea!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Possible quick way to fix corrupted permalinks site-wide’ is closed to new replies.