In this article, you will learn how to insert a PDF in WordPress without the need for a plugin. Without the need for a plugin, inserting a PDF in WordPress gives you more control over the functionality of your website and less dependence on extra third-party apps.
Follow these steps:
- Add a PDF file to the Media Library on WordPress:
- Open the WordPress dashboard and log in.
- Go to Media > “Add New Media File” from there.
- To embed a PDF file, upload it.
- To duplicate the URL for the PDF file:
- Select the “Media Library” tab once the PDF has been uploaded.
- To access and view the contents of the PDF you submitted, click on it.
- Select the PDF’s link and copy it using the “Copy URL to clipboard” option.
- Paste the URL into the post or page:
- To embed the PDF, either create a new post or adjust an old one.
- In the editor where you want the PDF to display, paste the copied URL. Here’s how it will appear:
https://yoursitename.com/wp-content/uploads/2024/01/your-pdf-file.pdf
- To embed the PDF, either create a new post or adjust an old one.
- Add Embedding Code:
- The following HTML code can used to embed the PDF as an iframe:
<iframe src=”https://yoursitename.com/wp-content/uploads/2024/01/your-pdf-file.pdf” width=”100%” height=”600px”></iframe>
- The URL of your PDF file should used in place of the one inside the src attribute.
- The following HTML code can used to embed the PDF as an iframe:
- Modify Width and Height (Optional):
- You can customize the tag’s width and height properties to suit your tastes. For optimal responsiveness, the width attribute should be set to 100%; you can change the height value as necessary.
- Publish or Update:
- To view the embedded PDF, publish your article or update the page after pasting the embedding code into it.
- To view the embedded PDF, publish your article or update the page after pasting the embedding code into it.
You can use these instructions to insert a PDF on your WordPress website without the need for a plugin. If the content of the PDF is not your own, just make sure you have permission to use and distribute it.
You can learn more about how to incorporate a new link into the WordPress sidebar!