Attachment pages stealing page slugs

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #1844


    I’m working on remaking a big website with its upload folder already full of many gigabits of images. I just noticed a problem I never noticed with WordPress before: it seems to create attachment pages based on the name of the images, which means that it “steals” most of the page slugs I want to use.

    For example, let’s say I have an image named about.jpg in my upload folder. The URL []( will be created and automatically redirect to that image. Now, if I want to create a regular page named *About*, the URL doesn’t have the priority on the attachment and will be forced be called [](

    It’s quite frustrating to not have clean URLs, and I haven’t found much on the web about it, which is strange. It tried the filter mentioned [here]( but it doesn’t seem to do anything. Any help would be appreciated. Thank you 🙂


    Well, I probably won’t have an answer but I’ve found a workaround. Here goes if someone has the same problem:

    In the database, you can search for the attachment page that’s causing problem, you’ll find it in wp_posts by searching for its post_name (which is the slug you want). Then just rename that post_name (*about-img* for example). It isn’t a fix but it will make the desired slug available for your page’s URL.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.