Clicksmith PDF Viewer: embed PDFs with one shortcode
Show a PDF right on the page with no ads, no upsells and no third-party viewer. Pick a file from your Media Library, set the width and height, copy the shortcode and paste it anywhere: pages, posts, Elementor widgets or the included Gutenberg block.
- Free and open source
- No ads or upsells
- Shortcode and Gutenberg block
- Works in Elementor
- Tested up to WordPress 6.8

What it does
The plugin uses the PDF viewer already built into the visitor’s browser, so there is no heavy JavaScript viewer to load and nothing is sent to an outside service.
Native browser rendering
The PDF is embedded with a standard object and iframe element. Chrome, Edge, Firefox and Safari display it inline with their own controls.
Sized the way you want
Set the width and height per embed, in pixels, percent or viewport units. A 100% wide, 800 px tall viewer is the default.
Open on a specific page
Add a page number and the viewer jumps straight to it, handy for long reports, menus and catalogs.
Optional download link
A download link is shown under the viewer by default. Turn it off per embed when a document should be read on the page only.
PDF Embeds post type
Save each PDF as a reusable embed in the PDF Embeds menu, configure it once, and copy the shortcode from the edit screen with one click.
Graceful fallback
If a browser can’t display the PDF inline, visitors see a short message with links to download it or open it in a new tab.
How to use it
- Install and activate.In WordPress go to Plugins, Add New, search for “Clicksmith PDF Viewer”, then Install and Activate.
- Create a PDF embed.Go to PDF Embeds, Add New. Choose a PDF from your Media Library or paste a direct URL, then set the width and height.
- Copy the shortcode.Publish the embed and click Copy in the Shortcode box on the edit screen.
- Paste it anywhere.Drop the shortcode into a page, post, or an Elementor Shortcode or Text Editor widget. In the block editor you can use the PDF Embed block instead.
Good to know
Same-domain PDFs work best. Upload files to your own Media Library. A PDF hosted on another domain can be blocked by that site’s security headers.
Mobile browsers vary. Some phones open PDFs in a separate viewer instead of inline. The fallback message and download link cover that case automatically.
No data leaves your site. The plugin loads the file directly from your server. There are no external scripts, fonts or trackers.
Shortcode reference
The main shortcode is pdf_viewer. Give it either the attachment ID of a PDF in your Media Library or a direct URL that ends in .pdf.
[pdf_viewer id="123" width="100%" height="800px" page="2" download="false"]
[pdf_viewer url="https://example.com/files/menu.pdf" height="90vh"]
| Attribute | Default | What it does |
|---|---|---|
id | none | Attachment ID of a PDF in the Media Library. Use this or url. |
url | none | Direct link to a PDF file. Must end in .pdf. |
width | 100% | Any CSS width, such as 100%, 720px or 80vw. |
height | 800px | Any CSS height, such as 800px or 90vh. |
page | first page | Page number to open on. Support depends on the browser’s PDF viewer. |
download | true | Set to false to hide the download link under the viewer. |
Lightweight iframe alternative
A second shortcode, clicksmith_pdf, renders a lazy-loaded iframe only. It accepts src, width (default 100%), height in pixels (default 700), toolbar and download (true or false), an optional title for screen readers and a custom class.
[clicksmith_pdf src="https://example.com/files/report.pdf" height="900" toolbar="true" title="2026 annual report"]
Frequently asked questions
Can I hide the download link?
Yes. Add download="false" to the shortcode, or switch it off when you configure the embed in PDF Embeds.
Can the viewer open on a certain page?
Yes. Add page="3" to open on page three. Most desktop browsers honor this. Some mobile viewers ignore it.
Can I embed a PDF that lives on another website?
Any direct .pdf link works as long as the other site allows embedding. For reliable results upload the file to your own Media Library.
Does it work with Elementor?
Yes. Paste the shortcode into a Shortcode widget or a Text Editor widget. In the block editor, use the PDF Embed block that comes with the plugin.
Does it use PDF.js or another third-party viewer?
No. It relies on the browser’s built-in PDF viewer, which keeps pages fast and avoids loading outside scripts.
Where do I get help?
Post in the WordPress.org support forum or contact Clicksmith directly.
What’s new
- 1.1.16 Admin menu now uses a built-in Dashicon.
- 1.1.12 to 1.1.15 Menu icon refinements, clearer fallback copy and updated documentation links.
- 1.1.9 Clearer fallback message when a browser can’t display the PDF inline.
- 1.1.7 Added documentation links in the plugin row and readme.
The full changelog is on the WordPress.org plugin page.
Resources
- Plugin listing on WordPress.org
- Support forum for questions and bug reports
- All Clicksmith WordPress plugins
Need something the plugin doesn’t do?
Clicksmith builds custom WordPress plugins and integrations, from gated document libraries to branded viewers with analytics. Tell us what you’re trying to publish.


