• Resolved david44qv

    (@david44qv)


    Hi wondering if anyone can assist with my issue. This used to work fine, and now something has changed and I have this issue.

    PDF attachments I upload to my Media Library, when I access them via the Media Library, and press “view attachment page,” it doesn’t show the PDF. Instead, it goes to this page on my website that I don’t recall making, but it has my header and footer. And the only thing there is this “Leave a Reply” text box.

    I have tried with a few different PDF’s, deleted them from library, re-uploaded them, etc.

    Has anyone experienced this issue or might be able to help me out? As far as I know, it used to work fine as I built a Button on my New Patients Page that allowed people to access a medical form .pdf we use. And it was working just fine before. But now I just get this “Leave a Reply” page instead of the browser showing the PDF like it used to.

    Thanks for any help! Using Elementor also.

    David

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator threadi

    (@threadi)

    The attachment page is set up by WordPress for each media file. It serves as a view of the file in the frontend, generated with a template from the theme used and thus also structured from its template parts. In your case, the Elementor templates from the header and footer are used here. In between, there is probably an output from your theme that also offers the option of comments.

    However, the “view attachment page” link is not available in WordPress. It is usually just called “View.” Next to it, you should also have a link called “Copy URL” that you can use to copy the actual PDF URL. See: https://wordpress.org/documentation/article/media-library-screen/

    This gives you the following tips:

    Hello @david44qv

    It looks like WordPress is opening the attachment page instead of the actual PDF file, which is why you’re seeing the “Leave a Reply” box with your site layout.

    A quick fix you can try: go to the Media Library, click on the PDF, and copy the File URL (not the attachment page link). Use that in your button or link – it should open the PDF directly like it used to.

    Also, if you’re using Yoast SEO, go to SEO > Search Appearance > Media, and make sure the option to redirect attachment URLs is set to Yes.

    Hope this helps 🙂

    Thread Starter david44qv

    (@david44qv)

    Thanks so much @threadi and @iammehedi1

    It looks like the issue was: I had disabled Yoast SEO

    I reenabled it and now it works good like before. Thanks for all the help, I am new to web design and WordPress

    David W

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘PDF attachments aren’t showing. Goes to a “leave a comment” page instead’ is closed to new replies.