- This topic has 1 reply, 1 voice, and was last updated 2 months, 1 week ago by morceaudebois.
- AuthorPosts
- November 8, 2020 at 10:52 pm #1844morceaudeboisParticipant
Hi,
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 [mysite.com/about](https://mysite.com/about) 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 [mysite.com/about-2](https://mysite.com/about-2).
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](https://wordpress.stackexchange.com/questions/179162/stop-wordpress-from-reserving-slugs-for-media-items) but it doesn’t seem to do anything. Any help would be appreciated. Thank you 🙂
November 8, 2020 at 10:52 pm #1845morceaudeboisGuestWell, 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.
- AuthorPosts
- You must be logged in to reply to this topic.