Pushing from staging to live breaks permalinks

After pushing from staging to production, I was getting 404’s for every single custom post type page. All that was needed to was resave permalinks.

It would be helpful if the push from staging to production also flushed the permalinks as a final stage. Doing so can’t negatively anything but will prevent a site becoming unusable after a staging -> prod push.

Thanks a lot

  • Adam Czajczyk
    • Support Gorilla

    Hi andycharrington

    I hope you’re well today and thank you for your feedback!

    When the site is pushed from staging to production (or the other way around) there’s a core WP CLI command executed to update all URLs and that’s a “WP way” of doing that that’s expected to take care of all of that.

    When the push is from staging to production additionally object cache would be regenerated so that makes sure that no “staging URLs” are “stuck in cache”.

    However, if URLs are wrong and re-saving permalinks helps it means that there’s something more involved and it would most likely be related either to some “internals” of the theme or to some plugin. There’s no support access enabled to the site currently so I can’t check more details but examples of such issues could be e.g. some builder plugins (and themes with their own custom “builders” or “customizers” built-in) that generate various files (usually CSS) dynamically. Such files often include references to URLs and that’s not being updated.

    It might also be some “non-standard” data format in the database or some “internal caching” of configuration data by some plugin.

    However, I’ve passed your suggestion over to our Hosting team for further consideration and they’ll be looking into it.

    Best regards,
    Adam

  • andycharrington
    • Flash Drive

    Or it could be what I said it was, which is that the permalinks need flushing.

    We don’t use page builders.

    We only use caching services provided by WPMUDEV.

    It’s easy enough for me to flush permalinks, I was more offering a suggestion for an improved service.

    Cheers.

  • Adam Czajczyk
    • Support Gorilla

    Hi andycharrington

    Thanks for response!

    As mentioned previously, I have passed your feedback over to our Hosting team already so they’ll look into it (in terms of possibly adding some permalinks flushing).

    I was just kinda “thinking out loud” about why this is even happening while it shouldn’t. I’m sorry if I have caused some confusing with this! But our hosting team will be looking into it in general.

    Best regards,
    Adam