Media Attachment Page displays File URL instead

What issue or error are you experiencing?

When trying to view the media attachment page for ANY media file, I am taken to the http://url.local/wp-content/uploads/year/month/filename.jpg file instead.

I have tried changing to a different theme to see if it was the theme I was using but it didn’t make a difference.

What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc

This happens every time I run a course for WP. I install LocalWP, set up a brand new website, install a free theme, create pages & posts, upload media etc. But every time the media attachment pages do not work. I’ve tried switching to a default WP theme, did not help, I also tried switching to Astra theme which I use on my own live website and the attachment pages work for it, but again it still doesn’t work using Astra theme in LocalWP.

System Details

  • Local Version:

  • Operating System (OS) and OS version:
    Windows 11 Home, Version 23H2. OS build 22631.3296.
    LocalWP Version 8.3.2+6660

Local Logs

Attach your Local Logs here (Help Doc - Retrieving Local’s Log)

Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

Hello @thetraininglady!

Do you have any plugins installed on this Local site that might be impacting media files?

Can you also please describe your desired outcome (perhaps what you see on your live site)?

Thank you!


No plugins installed.

Want to be able to demostrate during the class what the media attachment page looks like, currently cannot do that.

Hi @thetraininglady -

I think what you’re running into is not Local specific but is WordPress 6.4+

Let me know if this makes sense!


1 Like