PrintFriendly

Print Button Plugin or Print Stylesheet? How to Pick

Want your pages to print well? Here's how writing your own print CSS compares with adding a print button plugin, and when each one is the better call.

Print Buttonby PrintFriendly Team
Print Button Plugin or Print Stylesheet? How to Pick

Your recipe page looks great on screen and prints as six pages of menus, comment threads and a cookie banner. You can fix that two ways: write a print stylesheet, or add a print button plugin. They sound like two takes on the same thing, but they aren't. A print stylesheet changes what the browser prints from your page. A plugin gives readers a separate, cleaned-up copy to print, save as a PDF or email.

The short answer: if someone on your team writes CSS and you control your theme, write the stylesheet. If nobody does, or your readers want PDFs and a way to trim pages, a plugin saves you the work. You can also use both. Here's the detail.

What a plain print button does

A print button on its own is easy. An HTML button that calls window.print() opens the browser's print dialog for the current page, exactly as if the reader had pressed Ctrl+P (Cmd+P on a Mac).

That's also all it does. It doesn't change what gets printed, so the page comes out as it is: navigation, sidebars, ads, share buttons and all. Most "add a print button to your website" answers stop here. The button was never the hard part. The question is what lands on the paper.

Option 1: write your own print stylesheet

A print stylesheet is CSS that only kicks in when the page is printed. You put the rules inside an @media print block, or in a separate stylesheet linked with media="print". Rules in an @media print block apply to printed pages and print preview, and your screen layout stays exactly as it was.

The usual list of things a print stylesheet does:

  • Hide the navigation, sidebars, footer, ads, comment forms and the print button itself, with display: none.
  • Make the article full width, with dark text on a white background.
  • Set the page margins with the @page rule, which controls the printed page's size and margins.
  • Keep images, tables and boxes in one piece with break-inside: avoid (older tutorials call it page-break-inside).
  • Decide whether link URLs should print after the link text, since a reader can't click paper.

That's a short list, and for a simple site it's an afternoon's work.

Where a print stylesheet is good

  • It's free, and nothing third-party runs on your site.
  • It works for every print. Your button, Ctrl+P, the browser's menu: they all use the same print CSS. That matters, because plenty of people never look for a button.
  • Save as PDF gets it too. When a reader picks Save as PDF in the print dialog, they get the same cleaned-up layout.
  • You control every detail of the result.

Where it gets harder

  • Someone has to write CSS. If nobody on your team does, this option isn't really an option.
  • It's written against your theme. Every rule points at your theme's class names and layout. Change themes, or redesign, and the print CSS can quietly stop matching. Nothing tells you; the printouts just get worse.
  • Printing has its own surprises. A printed page is narrower than most desktop screens, so your theme's mobile layout can show up on paper, header and all. A fixed header can print at the top of every page and sit on top of your text. Accordions and tabs print the way they are on screen, so collapsed content stays collapsed. Big images can split across two pages.
  • Backgrounds and colors can drop out. When printing, a browser may leave out background images and adjust text colors so the page reads well on white paper. A white logo on a colored bar can vanish. The print-color-adjust property lets you ask the browser to keep them.
  • Readers get one fixed printout. They can't drop the paragraph or photo they don't want, and there's no "email me this" option.

Option 2: add a print button plugin

A print button plugin is a script, or a plugin for your content management system, that adds a button to your pages. Clicking it doesn't just open the print dialog: it opens a cleaned-up copy of the article that the reader can print, save as a PDF or send by email.

Our own is the PrintFriendly Print Button, so here's what that one does. Readers who click it get the article on its own (headline, text and images) without your navigation, sidebars or ads. They can delete any paragraph or picture they don't want and resize the text and images, then print it, save it as a PDF or email it. Printing and saving a PDF never ask for an account. The free button has no limit on how many readers use it, and the script does nothing until someone clicks. On WordPress there's a plugin that adds it without any code; anywhere else you paste a snippet from the button builder. If the printout needs a tweak, you can add your own CSS to it.

Where a plugin is good

  • No print CSS to write or keep up. The plugin works out which part of the page is the article, so there's no print CSS tied to your theme's class names.
  • Readers get more than paper: a PDF, an email, and a way to cut what they don't need. That's handy on recipes, patterns, guides and course material, where people want to keep one part.
  • It's quick to try. Paste code or install a plugin, and you're done.

Where it falls short

  • It's a third-party script on your site. Some teams have a rule against that, and that's a fair rule.
  • It only helps readers who click it. Someone who presses Ctrl+P or uses the browser's menu still gets your page as it is, unless you also have print CSS.
  • It decides what counts as the article. On an unusual layout it can pick the wrong block. Ours lets you correct that by adding classes to your own markup, but it's one more thing to check.

On our free button there are a few more trade-offs, and it's fairer to say them plainly. Readers go to printfriendly.com to see the clean copy, an ad shows beside the article, and the printout carries a small PrintFriendly credit. To email a copy, a reader needs a free PrintFriendly account. Pages behind a login or a paywall won't work on the free button. Pro opens the same view over your own page with no ads and no credit, and it works on members-only pages. It's a paid subscription per domain; prices are on the Print Button page. Our Print Button overview has the full free and Pro comparison.

Side by side

Plain window.print() button Your own print stylesheet Print button plugin (our free button)
What readers get The page as it is Your page, cleaned up by your CSS A separate clean copy of the article
Skill needed A line of HTML Comfortable writing CSS Paste code or install a plugin
Cost Free Free (your time) Free; Pro is paid
When the theme changes Nothing to update You update the CSS No print CSS to update
Ctrl+P and the browser menu Same page as it is Cleaned up Your page as it is
Reader can remove parts No No Yes
PDF Through the print dialog Through the print dialog Yes, its own PDF
Email a copy No No Yes, with a free account
Third-party script No No Yes
Ads None None One beside the article (none on Pro)
Members-only pages Prints what the reader sees Prints what the reader sees Not on free (works on Pro)

Which to use when

Write the stylesheet if a developer looks after your site, you control the theme, and you have a handful of page templates. It's free, nothing third-party runs, and it fixes Ctrl+P too, which is how a lot of people print. For many sites, that's the better answer.

Add a plugin if nobody on your team writes CSS, you're on a site builder or a theme you don't control, or your readers want PDFs and a way to trim the page. Recipe sites, pattern sites, how-to guides and course pages fit here: the reader wants to keep one part, not the whole page.

Stick to your own CSS if sending readers off your site or showing an ad next to your content is a deal breaker, or your content is members-only. A paid tier that opens over your own page is the other way around that.

Do both if you want the best of each. A short print stylesheet makes Ctrl+P decent, and a button gives readers who want it a trimmed copy, a PDF or an email. They don't get in each other's way.

A two-minute test before you pick

Open one of your own articles, press Ctrl+P (Cmd+P on a Mac) and look at the print preview. If it already looks fine, a plain window.print() button, or nothing at all, may be all you need.

If it doesn't, try the plugin route before you install anything: our button demo runs the real Print Button on a sample article, so you can see what your readers would get.

One last thing: if what you really want is a print button in your own browser, for every site you visit, that's a browser extension rather than something for your website.

Frequently Asked Questions

  • Do I need a plugin to add a print button to my website?

    No. A button that calls window.print() is one line of HTML and opens the browser's print dialog. A plugin is about what gets printed, not about the button.

  • Can a print button save a web page as a PDF?

    A plain button opens the print dialog, and most browsers offer Save as PDF in it. A print button plugin may add its own PDF download on top of that.

  • Does a print stylesheet work when readers press Ctrl+P?

    Yes. Print CSS applies every time the page is printed, whether the reader clicked your button, pressed Ctrl+P or used the browser's menu.

  • How do I hide elements when printing with CSS?

    Put the selectors inside an @media print block and give them display: none. Menus, sidebars, footers and the print button itself are the usual ones.

Sources

  1. Window: print() method, MDN Web Docs (Mozilla). Calling window.print() opens the browser's print dialog for the current page.
  2. @media CSS at-rule, MDN Web Docs (Mozilla). CSS rules inside @media print apply only when the page is printed or shown in print preview.
  3. @page CSS at-rule, MDN Web Docs (Mozilla). The CSS @page rule sets the margins and size of the printed page.
  4. print-color-adjust CSS property, MDN Web Docs (Mozilla). Browsers can leave out background colours and images when printing, and the print-color-adjust property lets a page ask for them to be kept.

Related Articles