MasterCopy for WordPress - Documentation
Table of Contents
Master Copy adds a simple “Copy to Clipboard” experience to your website. Visitors can copy code snippets, coupon codes, quotes, messages, deals, emojis, symbols, and more with one click. You can create copy boxes manually (block, widget, shortcode) or auto-insert copy buttons site-wide using templates (selectors + conditions).
Requirements
- WordPress 6.0+ recommended
- PHP 7.4+ recommended
- Gutenberg editor (for the block)
- Elementor (optional, only if you use the Elementor widget)
Installation
Install from WordPress Admin
- Go to Plugins → Add New.
- Search for Master Copy for WordPress.
- Click Install, then Activate.
Install via ZIP Upload
- Download the plugin ZIP.
- Go to Plugins → Add New → Upload Plugin.
- Upload the ZIP, then click Install Now.
- Click Activate.
After Activation
- Open Settings → Master Copy to configure global defaults.
- Open MasterCopy → Copy Templates to create automatic copy rules.
Quick Start
Option A: Add a Copy Box Manually
- Open a post or page editor.
- Add the Master Copy block (Gutenberg) or the MasterCopy widget (Elementor).
- Enter your text (code, coupon, quote, etc).
- Pick a style (button, icon, cover) and publish.
Option B: Auto Add Copy Buttons (Recommended for Site-Wide Use)
- Go to MasterCopy → Copy Templates.
- Click Add New Template.
- Set the selector (example:
preor.coupon-code). - Set placement and display rules.
- Save, then test on a real page.
Gutenberg Block
The Gutenberg block creates a copy box inside your content. It is best for specific sections like “Copy this code” or “Copy this coupon”.
Add the Block
- Edit a post or page.
- Click + and search for Master Copy.
- Insert the block and add your text.
Block Settings (Typical)
- Box Type: code, coupon, quote, message, deal, custom
- Copy Style: button, icon, button + icon, cover overlay
- Button Text: default “Copy to Clipboard”
- After Copy Text: default “Copied!”
- Button Title: tooltip text for accessibility
- Icon: choose a copy icon (Font Awesome or built-in)
Elementor Widget
The Elementor widget gives you a copy box with similar controls, made for Elementor layouts and landing pages.
Add the Widget
- Open Elementor editor.
- Search for MasterCopy in widgets.
- Drag it into your section.
- Enter your content and adjust settings.
Widget Controls (Typical)
- Content: text to display and copy
- HTML Element: wrap content as
div,p,code,pre,span, headings, and more - Copy UI: button, icon, cover overlay
- Styles: typography, spacing, border, background, hover
Shortcodes
Use shortcodes when you want copy boxes inside classic editors, custom fields, templates, or builder modules that accept shortcodes.
Copy Box Shortcode
[mastercopy]Your text here[/mastercopy]Common Attributes
- style:
button,icon,button_icon,cover - button_text: label for the button
- copied_text: label after copying
- icon: Font Awesome class name, example:
fa-solid fa-copy
Example
[mastercopy style="button_icon" button_text="Copy" copied_text="Copied!" icon="fa-solid fa-copy"]MASTERCOPY20[/mastercopy]Inline Copy Shortcode
Use inline copy when you want a small clickable copy element inside a sentence.
[mastercopy_inline text="MASTERCOPY20" label="Copy code"]Copy Templates (Auto Insert)
Copy Templates automatically attach copy buttons to existing content, based on selectors and rules. This is the best option when you want copy buttons across your whole site without editing every page.
Create a Template
- Go to MasterCopy → Copy Templates.
- Click Add New Template.
- Set your selector and optional scope.
- Choose UI style and placement.
- Add display conditions if needed.
- Save and test.
Template Editor Layout
- Left panel: template settings, rules, styles
- Right panel: live preview of your copy UI
Selectors and Targeting
Selector Examples
- All code blocks:
preorpre code - All inline code:
code - All blockquotes:
blockquote - Specific class:
.coupon-code - Specific id:
#offerText - Headings only:
h2, h3
Scope Control (Parent Selector)
Use a parent selector to limit your template to a specific area, for example only inside post content.
- Common scope:
.entry-content - Another scope:
.elementor-widget-container
Exclude Selectors
Exclude selectors to avoid adding copy buttons to unwanted elements.
- Exclude example:
.no-copy - Exclude example:
pre.no-mastercopy
Button Placement
- Inside: button appears inside the target element
- Outside: button appears next to the target element
- Corner: top-left, top-right, bottom-left, bottom-right
- Before/After: insert before or after the target element
UI Modes
- Button: visible button with label
- Icon: minimal icon-only copy action
- Button + Icon: label plus icon
- Cover: overlay style that appears on hover
Display Conditions
Display conditions control when a template is shown. You can create “Show if” rules and “Hide if” rules.
Common Conditions
- Post Type: posts, pages, products, CPTs
- Taxonomy: category, tag, custom taxonomy terms
- User Role: admin, editor, subscriber, guest
- Login State: logged in or logged out
- URL Rules: contains, equals, starts with
Examples
- Show on posts only: Post Type is
post - Hide on checkout page: URL contains
/checkout - Show only for logged-in users: User is logged in
Copy Formatting
Formatting controls what is placed into the visitor’s clipboard.
Copy Formats
- Plain Text: best for coupons and simple text
- Preserve Line Breaks: best for code snippets
- Cleaned Text: remove extra spaces and unwanted characters
Content Processing (Optional)
- Trim: remove leading and trailing spaces
- Prefix/Suffix: add text before or after copied content
- Hidden Copy Value: copy a different value than what is displayed
Styling and Customization
Global Defaults
Set default labels and styles once, then reuse them everywhere.
- Default Button Text: “Copy to Clipboard”
- After Copy Text: “Copied!”
- Default Icon: copy icon
Per Template Customization
- Button Labels: per template control of Copy and Copied text
- Icon: per template selection
- Position: per template placement
- Styles: colors, borders, spacing, hover
Copied Feedback Styles
- Inline: replace button text with “Copied!”
- Tooltip: small tooltip near the button
- Toast: small popup message
Performance
- Conditional loading: assets can load only when MasterCopy is used on a page
- Scoped targeting: use a parent selector to reduce scanning
- Template priority: avoid multiple matches to the same element
Accessibility
- Keyboard support: copy buttons can be focused and activated with keyboard
- Screen readers: “Copied!” feedback can be announced using accessible labels
- Tooltips: use button title for clearer meaning
Troubleshooting
Copy Button Does Not Appear
- Confirm the selector matches real elements on the page.
- Set a parent scope like
.entry-contentif your theme wraps content. - Check display conditions, a “Hide if” rule may block it.
- Clear cache (page cache and minification cache) and test again.
Text Copies Incorrectly
- Switch formatting to Preserve Line Breaks for code.
- Enable trimming or cleaned text for messy content.
- If the page builder modifies the text, use a hidden copy value option.
Duplicate Copy Buttons Appear
- Check if multiple templates match the same element.
- Increase priority for the template you want to win.
- Add exclusions for the template you do not want applied.
Conflicts With Other Copy Plugins
- Disable other clipboard plugins to avoid duplicate UI and event conflicts.
- Test in an incognito window and with cache cleared.
FAQ
Does MasterCopy work on posts, pages, and custom post types?
Yes, you can enable templates and conditions for posts, pages, and CPTs.
Can I add copy buttons automatically to code blocks?
Yes. Create a template targeting pre or pre code.
Can I change “Copy” and “Copied!” text?
Yes. Set global defaults, or override per block, widget, shortcode, or template.
Does it work with Elementor?
Yes. Use the Elementor widget, or use Copy Templates to target Elementor content output.
Can I show or hide copy buttons on specific pages?
Yes. Use URL rules and display conditions, including exclusions.
Glossary
- Copy Box: a styled container with a copy action.
- Template: an automatic rule that targets elements with a selector.
- Selector: CSS pattern that matches elements on a page, example
preor.coupon-code. - Scope: a parent selector used to limit where a template applies.
- Conditions: rules that control when a template is shown or hidden.
Support
For support, include:
- The page URL where the issue happens
- Your selector and scope settings
- A screenshot of the template settings
- Any cache/minify plugin names you use
