• Resolved rooobreyes

    (@rooobreyes)


    Hello,

    We have this weird issue, we removed the “/courses” prefix for the post type “courses” using the plugin but for some unknown reason there are times that the prefix is reverting back causing 404 errors on the site.

    Current Settings:
    https://www.dropbox.com/s/jkpf38hpv8zutcr/chrome_rslW5BCD9X.png?dl=0

    Issue:
    02.08.2021-22.08.50

    Ways to replicate the issue(?):
    Editing a course triggers the issue as seen on several instances whenever the client updates the content.

    Our temporary fix is to have the URLs regenerated again, but that doesn’t help and cannot really call a fix.

    Awaiting your favorable reply and help.

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Maciej Bis

    (@mbis)

    Hi @rooobreyes,

    It looks like the posts with broken permalinks are for some reason recognized by my plugin as either excluded or disabled. Therefore, their custom permalinks (without the /course/ prefix) are removed and original permalink reverted.

    Could you check if the issue persists if “Automatically fix broken URIs” option is disabled in Permalink Manager settings?

    Please accept my apology for the inconvenience!

    Best regards,
    Maciej

    Thread Starter rooobreyes

    (@rooobreyes)

    Hi Maciej,

    Thanks for the swift response, will try that out and get back to you as soon as possible.

    Regards,
    Rob Reyes

    Thread Starter rooobreyes

    (@rooobreyes)

    Hi Maciej,

    As promised I’m back and the result was the issue still persist when updating a course and all URLs are reset again.

    Regards,
    Rob Reyes

    Plugin Author Maciej Bis

    (@mbis)

    Hi @rooobreyes,

    It would be difficult to find out what exactly makes my plugin reset the courses permalinks. Do you possibly have any staging website, where I can debug this problem?

    The other idea would be to force my plugin to save the default permalink again whenever the single course is updated (then you would not need to manually “regenerate/reset” custom permalinks to apply the correct format):
    https://pastebin.com/Jmnucupk

    Best regards,
    Maciej

    Thread Starter rooobreyes

    (@rooobreyes)

    Hi @mbis,

    Thanks for the response, I’ll try the code you just sent and get back to you again. If no luck with the issue, I’ll setup a staging site for you.

    Regards,
    Rob

    Thread Starter rooobreyes

    (@rooobreyes)

    Hi @mbis,

    We have been monitoring the issue for a while now, but this time the URLs shifted back again even with no admin interactions are made.

    The code that you provided last time is already on the function.php file of the theme but it seems that didn’t work as well.

    We even checked if flush_rewrite() is causing the issue.

    We already have a copy of the live site on staging for you to debug the issue, let me know if where I can send you the credentials.

    Regards,
    Rob

    Plugin Author Maciej Bis

    (@mbis)

    Hi @rooobreyes,

    Please send the credentials to my email address:
    contact /at/ maciejbis.net

    Best regards,
    Maciej

    Thread Starter rooobreyes

    (@rooobreyes)

    Hi @mbis

    You should receive a reset password URL for username maciejbis, I also changed it to superadmin access.

    Currently the site is on a multisite setup, the issue is only happening on the EN site which is a weird case.

    Let me know if you need an SFTP access as well.

    Regards,
    Rob

    Plugin Author Maciej Bis

    (@mbis)

    Hi @rooobreyes,

    Thank you for credentials. The first thing I noticed is that “Automatically fix broken URIs” mode is still turned on.

    In past I had a few reports that my plugin can improperly mark custom post types items registered with CPT UI plugin as “invalid”.

    Could you check if the “reverted” permalinks are still stored in the array with custom permalinks used by my plugin? You can check them in “Permalink Manager -> Debug” section.

    Best regards,
    Maciej

    Thread Starter rooobreyes

    (@rooobreyes)

    Hi @mbis

    The “Automatically fix broken URIs” is already turned off on the live site when that happened.

    We had to quickly revert back the urls on live since the courses are the most visited pages on the site.

    https://www.dropbox.com/s/wfpi854006wkkpw/Lsvh9ekY9O.png?dl=0

    URL Array:
    https://www.dropbox.com/s/ubqyj5sqg772edu/Mnda3e9zKl.png?dl=0

    I think we can check the debug tab again if the issue occurs on the live site again.

    Regards,
    Rob

    Plugin Author Maciej Bis

    (@mbis)

    Hi @rooobreyes,

    Thank you! I would be grateful if you can check if the relevant custom permalinks are still stored in “Debug” tab after the issue appears again.

    Best regards,
    Maciej

    Thread Starter rooobreyes

    (@rooobreyes)

    Hi @mbis

    Is there a way we can restore the values from our staging site to the live site? All of the custom permalinks on one instance of our site is gone for some reason.

    Regards,
    Rob

    Plugin Author Maciej Bis

    (@mbis)

    Hi @rooobreyes,

    the custom permalinks are stored in “wp_options” table with “permalink-manager-uris” key.

    It would be difficult to debug this issue with your specific environment. Would you mind if I prepare you a tailored, alternative solution that would allow to remove CPT (course) prefix instead of my plugin?

    Best regards,
    Maciej

    Plugin Author Maciej Bis

    (@mbis)

    Hi again @rooobreyes,

    I prepared the mini-plugin that would allow you to dynamically remove /courses/ CPT base. You can find all the code in wp-content/plugins/bis/bis.php file on your staging website.

    Best regards,
    Maciej

    Thread Starter rooobreyes

    (@rooobreyes)

    Hi @mbis

    Thanks for the fix, we’ll have it deployed on live site as well and monitor if that fixes the issue.

    Will get back to you again.

    Regards,
    Rob

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘CPT Permalink Prefix Issue’ is closed to new replies.