0

I have a WordPress installation setup but I'm having trouble with items uploaded to the media library taking up pretty permalinks. The only way to fix it that I've figured out so far is to delete the image from the library. However the image in question is used all over the site so I would much rather find another solution.

Example:

Say I upload an image called foo.jpg then make a page called foo, the pretty permalink for the page becomes /foo-3. If you try and change it, it reverts back to 3, unless you use something that isn't 'taken'. If I navigate to url.com/foo I get the attachment page for the image and not the page.

I've tried changing the permalink settings to all the different settings. I've also tried renaming the image 'title' but that is no good either.

Is there anything else I can do to force the permalink?

Thanks

  • I can't get you what you want to do? – Vasim Shaikh Feb 16 '16 at 16:22
2

It's not your permalink settings, it's the fact that foo.jpg was uploaded first and "stole" the slug foo - you need to change it to something else, then set your page slug.

Go to Media > foo.jpg > Edit (if you are in grid view, you need to go to "Edit more details")

enter image description here

From this page you can edit the permalink/slug (just like pages/posts, right beneath the title field) and set it something that isn't foo.

Now go re-save your page with slug foo.

| improve this answer | |
  • Thanks, I completely forgot about this edit screen! However, next issue there seems to be no edit button for the permalink. On another WordPress installation I can see it, but on my local dev and a remote dev site I can't see it. Any ideas? – MattB Feb 16 '16 at 16:57
  • Nevermind, I was able to get around it be turning on the slug checkbox in the Screen options section and then edit it there. Thanks though! – MattB Feb 16 '16 at 17:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.