• I’m not sure how this happened, but I uploaded an image called 1.jpg. Shortly after, I created a page and tried to set the slug to /1, but it automatically changed to /1-2.

    I deleted the image and tried to change the page back to /1 but it wouldn’t take; it just kept going back to /1-2.

    When the image was still there, visiting mystite.com/1 took me to the attachment page for 1.jpg. Now that it’s gone, it takes me to a page that never even used the file 1.jpg. I don’t know how this happened.

    I can’t find any reference in the database or anywhere else that determines that /1 should go to the page it is going to now. I also can’t find any kind of plugin that displays all of the existing redirects or anything like that.

    Any ideas? I’m kind of at wit’s end here. Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Looks like this is an ongoing problem that actually should be fixed now. Plenty of results in Google talking about it: https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=wordpress%20attachment%20page%20slug

    Looks like it was addressed in WordPress 4.4. I can’t verify on my own so please do make sure your WP install is updated. https://core.trac.www.ads-software.com/ticket/24612

    I also saw this plugin. https://www.ads-software.com/plugins/slug4apig/ Hasn’t been updated in some time but that doesn’t mean it won’t work. So that’s worth a try.

    Comb through those resources and let me know if you make any progress.

    Thread Starter smackbomb

    (@smackbomb)

    Thanks for replying.

    I am running 4.4.2 and still having the problem. So 4.4 doesn’t seem to fix this particular thing.

    I am running Yoast SEO and there is this option:

    Redirect attachment URL’s to parent post URL.
    No redirect | Redirect
    Attachments to posts are stored in the database as posts, this means they’re accessible under their own URL’s if you do not redirect them, enabling this will redirect them to the post they were attached to.

    I have it set to Redirect but I have tried setting to No Redirect as well as deactivating Yoast completely and nothing made any difference. So while it could be a Yoast issue it doesn’t *seem* to be.

    I installed the plugin you mentioned and was able to change the slug of the attachment (which had been deleted, but I re-uploaded). It auto generated a slug of 1-2, which I thought was weird because that’s what my page is stuck on. I changed it to 1-2000 and went back to the page, and it still won’t let me set to 1; it just keeps changing back to 1-2 upon saving.

    So it looks like that plugin could help, but something else is wrong.

    Thread Starter smackbomb

    (@smackbomb)

    Is there somewhere I can look in the database where aliases/slugs are kept?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Slug from deleted image conflicts with page URL’ is closed to new replies.