WordPress.org

Ready to get started?Download WordPress

Forums

Redirection
URL monitoring shouldn't add redirects for custom post types (4 posts)

  1. jkohlbach
    Member
    Posted 10 months ago #

    Hi guys,

    I recently uncovered a problem where Redirection with the URL monitoring option enabled will add redirects for custom post types.

    I found this out because it borked the redirection destination URL in a couple of these redirects on a WooCommerce install and as a result these product pages were redirecting to the home page.

    In the options it says for Post and Pages only, I think you might be missing some validations to check which post type it is before going ahead and putting in a redirect. I could imagine some other plugins creating custom post types would have issues with this as well.

    Cheers,
    Josh

    http://wordpress.org/plugins/redirection/

  2. John Godley
    Member
    Plugin Author

    Posted 10 months ago #

    In what way is it wrong to redirect a custom post type? It seems to be a useful thing to do and core WP does this anyway.

  3. jkohlbach
    Member
    Posted 10 months ago #

    Hi John,

    The option specifically says Posts and Pages, so I wouldn't expect it to do so for CPTs.

    Not all CPTs need Redirection to handle URL changes, but I guess that point is up for debate.

    Maybe it would be better to have the option to exclude/include custom post types and have Pages and Posts on by default?

    Also as far as I know core doesn't manage 404s when slugs change.. can you expand?

  4. jkohlbach
    Member
    Posted 10 months ago #

    Hey again John,

    Just took a look through your changelog and it seems my problem was similar to the one fixed in 2.1.29

    2.1.29
    Fix problem with custom post types auto-redirecting (click on 'groups' and then 'modified posts' and clear any entries for '/' from your list)

    This is pretty much what happened, only I'm not on a version less than 2.1.29. This site was on 2.2.13 and only fairly recently re-launched with a fresh install.

    I can't seem to reproduce the issue, so I'm not sure if it was a once off or not... sorry I can't be more helpful!

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.