How-to guide

How to add a copy button to code blocks

Readers of a tutorial copy every command. Selecting text by hand is slow and picks up the “$” at the start. One line gives every code block a button that copies exactly what should be pasted.

  • One-time payment
  • Any website builder
  • Live in about 5 minutes
Copy Code: How to add a copy button to code blocksTry it live ↓

Try Copy Code right here

Press Copy on the block, then paste somewhere: the “$” is left out.

Works on the code blocks you already have, whatever made them

Leaves out the “$ ” before shell commands

The button stays in the corner while long lines are scrolled

How to add it to your website

Buy once, add your website in Fluri and pick Copy Code. You get one line of code like this:

<script defer src="https://fluri.xyz/install/loader.js"
  data-site="your-site-key"></script>

After that, change settings, pause it or switch themes from your dashboard. You never edit your site again.

  1. In WordPress, go to Plugins → Add New and install a header and footer code plugin such as WPCode.
  2. Open Code Snippets → Add Snippet → Add Your Custom Code, and choose HTML snippet.
  3. Paste your Fluri snippet, set Location to Site Wide Footer and switch the snippet to Active.
  4. Save, open your website and press Check installation in your Fluri dashboard.

On a classic theme you can instead paste the snippet just before </body> in your theme’s footer.php (use a child theme so updates don’t remove it). Full WordPress guide

Questions

Something else? Send us a message.

Does it work with Prism, highlight.js or Shiki?

Yes. It works on ordinary pre blocks, so it doesn’t matter which highlighter, or none, coloured the code.

Why leave out the “$”?

Tutorials show “$ npm install” to mark a shell command, but the “$” is not part of the command. Copied with it, the command fails. You can switch this off.

Can the button appear on hover only?

Yes. On touch screens, where there is no hover, it stays visible.

How much does it cost?

$19 once, with no subscription. That includes Copy Code and all 65 other themes, on as many websites as you like.

Give your website a little life today.

Pick a theme, pay once, paste one line. It’s live in minutes.