Copy Anything to Clipboard

Advertisement

We are happy to see that you are using our Copy Anything to Clipboard a FREE WordPress plugin.

The plugin provides the feature to copy the text, blockquote, code, or even HTML into the clipboard.

So, Without wasting time let’s see how to use it.

Copy Anything to Clipboard plugin provides multiple ways to copy the content.

So, You can choose the way as per your content type.

Below is the list of all those ways:

Way 1 – Copy with Shortcode Way 1 – Copy with Shortcode

Shortcode is the easiest way to start with.

You just need to use the [copy] shortcode.

If you are aware of shortcodes then don’t worry.

Just use the same as I share in the below example:

Example 1: Copy Same Display Text in Clipboard Example 1: Copy Same Display Text in Clipboard

I have the below text:

The zoom meeting is scheduled on data 15 November 2022 please note down it.

I want to allow my students to copy the scheduled date which is 15 November 2022 into the clipboard.

So, To achieve it use the shortcode as:

The zoom meeting is scheduled on data [copy]15 November 2022[/copy] please note down it.

Here, I have just wrapped the shortcode to the date 15 November 2022.

See below LIVE example text:

“The zoom meeting is scheduled on data 15 November 2022 please note down it.”

Here,

In the above paragraph, Just click on 15 November 2022 which will copy to the clipboard.

Top ↑

Example 2: Copy Different Text than Display Text in Clipboard Example 2: Copy Different Text than Display Text in Clipboard

In the above example, we copy the date on click on itself.

Sometimes we want to show different text and copy different text to the clipboard.

E.g.

Hello Students,

Please save the next meeting link https://meet.google.com/_meet/mbz-zncr-efk?ijlm=1659873953647&adhoc=1&hs=187 for next meeting.

Here,

I can show different text for the link and when students click on that text the link will copy to the clipboard.

To achieve this, I will add the shortcode as below:

Hello Students,

Please save the next meeting link [copy content="https://meet.google.com/_meet/mbz-zncr-efk?ijlm=1659873953647&adhoc=1&hs=187"]Click to Copy Link[/copy] for next meeting.

With this students can click on the Click to Copy Link text and copy the Google Meet link to the clipboard.

See LIVE example:

Hello Students,

Please save the next meeting link Click to Copy Link for next meeting.

In the above paragraph, Just click on the Click to Copy Link text.

Enough?

Nope,

The shortcode has more powerful features as:

Top ↑

Shortcode Parameters Shortcode Parameters

copied-text

After copying, we see the text “Copied to Clipboard“. We can change it by adding copied-text as a parameter.

[copy copied-text="Yup! Copied"]Hello World[/copy]

Here, I have added the text Yup! Copied so when I click on the text I see this text.

See below LIVE example:

Hello World

tag

When we use the shortcode then it’s displayed in the <span> tag.

If you want to show it in <a> the anchor tag. Or, as a link then use it as below:

[copy tag="a"]Hello World[/copy]

Here, I have added the tag as a. So, We can see the text in the link.

See below LIVE example:

Hello World

Another example,

Same as a link, If you want to show the text into the button then just add the tag as a button.

[copy tag="button"]Hello World[/copy]

Here, I have added the tag as a button. So, We can see the text in the link.

See below LIVE example:

Top ↑

Way 2 – Copy with Target Way 2 – Copy with Target

This is the most useful way and is mostly used by a lot of users with this plugin.

With the help of target, you can copy any text from any HTML tag.

Most users use this feature for blockquote.

So, Let’s see how to copy the block quote content into the clipboard.

Top ↑

Use Case 1: How to add the copy button to Blockquote Use Case 1: How to add the copy button to Blockquote

Suppose below is the text which, I want to allow the user to copy to the clipboard.

<blockquote>
“If life were predictable it would cease to be life, and be without flavor.” – Eleanor Roosevelt
</blockquote>

To add a copy button

Step 1 – Go to “Copy to Clipboard”
Step 2 – Click on the “Add New” button

See the below screenshot for reference:

Copy Anything to Clipboard 1
Copy Anything to Clipboard 17

You’ll see the screen something as below:

Copy Anything to Clipboard 2
Copy Anything to Clipboard 18

Now, Just do:

Step 1 – Add the selector as a blockquote
Step 2 – Click on “Create”

E.g.

Copy Anything to Clipboard 3
Copy Anything to Clipboard 19

DONE!

That’s it. You don’t need to do anything. If you visit the blockquote you’ll see something as below:

Copy Anything to Clipboard 4
Copy Anything to Clipboard 20

The Copy button is automatically displayed to you.

Just click on it. The Blockquote text is copied to the clipboard.

See the LIVE example below:

“If life were predictable it would cease to be life, and be without flavor.”

– Eleanor Roosevelt

Top ↑

Use Case 2: How to add the copy button to Code Snippet Use Case 2: How to add the copy button to Code Snippet

Another usage of Copy Anything to Clipboard is by copying the code snippets.

E.g.

<?php
     echo 'Hello World';
?>

Above is the sample PHP code snippet in which I want to add the copy button.

Now, See how to do it.

Step 1 – Click on “Add new”

Copy Anything to Clipboard 5
Copy Anything to Clipboard 21

Step 2 – Add the pre tag as selector

Step 3 – Select the button style

Copy Anything to Clipboard 6
Copy Anything to Clipboard 22

Here,

We can see the button style and the live preview.

You can change the site with SVG icon as:

Copy Anything to Clipboard 7
Copy Anything to Clipboard 23

Now, Click on create.

NOTE: You may see something below error. It’s basically you have the same selector created before. Just change the selector.

Copy Anything to Clipboard 8
Copy Anything to Clipboard 24

Finally, click on Create

You’ll see the screen below:

Copy Anything to Clipboard 9
Copy Anything to Clipboard 25

On click on the SVG icon, the code is copied to the clipboard.

See below LIVE example

<?php
    echo 'Hello World';
?>

Top ↑

Use Case 3: How to add the copy button to HTML list Use Case 3: How to add the copy button to HTML list

Some users request the feature to copy the HTML list.

E.g.

<ul>
    <li>Chapter 1 Real Numbers.</li>
    <li>Chapter 2 Polynomials.</li>
    <li>Chapter 3 Pair of Linear Equations in Two Variables.</li>
</ul>

Suppose you want to add the copy button to this list.

To do this, Follow below steps:

Step 1 – Click the class which exists for your ul or li HTML tag as:

Copy Anything to Clipboard 10
Copy Anything to Clipboard 26

Here, We can see the class copy-list which exists for the ul tag.

I am using Gutenberg and in Gutenberg editor, we can add a class manually from:

Copy Anything to Clipboard 11
Copy Anything to Clipboard 27

No matter which editor you are using.

You can use any editor e.g. Elementor, Gutenberg, Divi, or Beaver Builder.

Just check if the class or ID exists for that list.

Step 2 – Now, Click on “Add new”

Copy Anything to Clipboard 12
Copy Anything to Clipboard 28

Now, You can see the copy button added to both list.

NOTE: I had added the same class to the two lists.

Copy Anything to Clipboard 13
Copy Anything to Clipboard 29

See below LIVE example:

  • Chapter 1 Real Numbers.
  • Chapter 2 Polynomials.
  • Chapter 3 Pair of Linear Equations in Two Variables.

Top ↑

Other Customizations Other Customizations

Enough?

Nope, You can even do more customizations like:

  • Change Copy button text
  • Change Copied text
  • Change Button Style
  • etc.
Copy Anything to Clipboard 14
Copy Anything to Clipboard 30

You can change the button text, Title Text, and even the button copied text too.

Just click on the edit button and change the values and click on Update.

Copy Anything to Clipboard 15
Copy Anything to Clipboard 31

Top ↑

How to Download? How to Download?

Simply scan the QR code below to go to the download page:

Copy Anything to Clipboard 16
Scan the Code

Or, Visit https://wordpress.org/plugins/copy-the-code/

114 thoughts on “Copy Anything to Clipboard

      1. Hi Mahesh,
        first: great plugin – congrats!

        So pls can you tell me, how to style the button with the customizer? I try a lot with Simple Custom CSS but there’s nothing i could change by myself…
        thx a lot!

        Peter

      1. Hi Mahesh,
        first: great plugin – congrats!

        So pls can you tell me, how to style the button with the customizer? I try a lot with Simple Custom CSS but there’s nothing i could change by myself…
        thx a lot!

        Peter

  1. Would really like to use your plugin.. but my page has dynamic data that is populated AFTER the page loads using js. Is there a quick work-around or code change I could make to the plugin to get a copy button attached to the dynamic class that populates AFTER page is loaded?

  2. Would really like to use your plugin.. but my page has dynamic data that is populated AFTER the page loads using js. Is there a quick work-around or code change I could make to the plugin to get a copy button attached to the dynamic class that populates AFTER page is loaded?

  3. The copied text after I click on the button shows on left sides which comes over the content and it doesn’t look good. Is there a way to display the tet on right side ?

  4. The copied text after I click on the button shows on left sides which comes over the content and it doesn’t look good. Is there a way to display the tet on right side ?

  5. I really liked the plugin, but i’m currently looking forward to find away to make the plugin copy a hyperlink below a specific text, i tried but i only found that the plugin can only copy the text in the frontend.
    I will really appreciate if you can guide me to customize the plugin to could be able to copy the hyperlink!!

  6. I really liked the plugin, but i’m currently looking forward to find away to make the plugin copy a hyperlink below a specific text, i tried but i only found that the plugin can only copy the text in the frontend.
    I will really appreciate if you can guide me to customize the plugin to could be able to copy the hyperlink!!

  7. Wonderful plugin!!

    I just noticed that it’s not copying blank lines. I’m using it for the pre tag. When I inspect, I can see that there are no visible line breaks in the html in the inspector.

    But when the text is copied manually, there is no problem, I get the blank lines.

    Ideas?

  8. Wonderful plugin!!

    I just noticed that it’s not copying blank lines. I’m using it for the pre tag. When I inspect, I can see that there are no visible line breaks in the html in the inspector.

    But when the text is copied manually, there is no problem, I get the blank lines.

    Ideas?

  9. how can i copy of my shortcode link
    because i have gamipress link {[gamipress_referral_url rl=”http://website.com/”]}
    how can i copy actual link using copy to clipboard ????

  10. how can i copy of my shortcode link
    because i have gamipress link {[gamipress_referral_url rl=”http://website.com/”]}
    how can i copy actual link using copy to clipboard ????

  11. Hi, looks greate plugin, I check one issue in this plugin that: when i used in to copy code its not seprate same as showing in blog: space formating issue

  12. Hi, looks greate plugin, I check one issue in this plugin that: when i used in to copy code its not seprate same as showing in blog: space formating issue

  13. Is there a way to copy the formatting of whatever is in the tags — I have several paragraphs and a bulleted list that includes a link… after using the “copy” button on that section, when I paste into Gmail (for example) it only pastes plain text. The paragraph formatting and link are gone.

  14. Is there a way to copy the formatting of whatever is in the tags — I have several paragraphs and a bulleted list that includes a link… after using the “copy” button on that section, when I paste into Gmail (for example) it only pastes plain text. The paragraph formatting and link are gone.

    1. Hello,

      It was the analytics data which used recently.

      Not, its no longer needed as the Freemius SDK is included in the plugin which does it very well.

      The code was deprecated and removed from our current development release so it’ll not exist in the upcoming release.

    1. Hello,

      It was the analytics data which used recently.

      Not, its no longer needed as the Freemius SDK is included in the plugin which does it very well.

      The code was deprecated and removed from our current development release so it’ll not exist in the upcoming release.

  15. Hi, this is a great plugin. I have a question for you. We are aiming to create a button that allows people to copy the content code of a blog post (not the text but the html.) I got it to copy the text using the selector “article.” Is there a way to get it to copy the code instead? We are essentially trying to duplicate the Republish This function on this site (scroll to the bottom): https://columbianewsservice.com/2022/05/17/gonna-do-it-my-way-a-bronx-natives-accidental-road-to-home-ownership-and-housing-activism/ Thank you! Chris

    1. Hello 👋,

      If I understand correctly then you want to add a copy button to article. And on click on that button you want to copy the HTML of article selector.

      If yes. Then please share the page URL where I see the page and the article and reproduce and check it on my local environment.

      Once I get it then I’ll provide you the possible solution.

      Also, instead of discussing here we’ll discuss though email.

      Please refer my email for further discussion:
      mwaghmare7@gmail.com

      1. Hi Mahesh. Thanks for the great plugin. I’m interested in this solution too, so that I can copy HTML-formatted text to a Microsoft Word document. Did you manage to get this working for Christine? Happy to continue discussion by email if that’s preferable. Thanks for your help.

      2. Hi,

        I’m bit confused about Christine word. What is the meaning of this? In which context you want to use the plugin.

        We’ll discuss here as well. But if it’s something non public information or long threaded information then we’ll discuss over email.

  16. Hi, this is a great plugin. I have a question for you. We are aiming to create a button that allows people to copy the content code of a blog post (not the text but the html.) I got it to copy the text using the selector “article.” Is there a way to get it to copy the code instead? We are essentially trying to duplicate the Republish This function on this site (scroll to the bottom): https://columbianewsservice.com/2022/05/17/gonna-do-it-my-way-a-bronx-natives-accidental-road-to-home-ownership-and-housing-activism/ Thank you! Chris

    1. Hello 👋,

      If I understand correctly then you want to add a copy button to article. And on click on that button you want to copy the HTML of article selector.

      If yes. Then please share the page URL where I see the page and the article and reproduce and check it on my local environment.

      Once I get it then I’ll provide you the possible solution.

      Also, instead of discussing here we’ll discuss though email.

      Please refer my email for further discussion:
      mwaghmare7@gmail.com

      1. Hi Mahesh. Thanks for the great plugin. I’m interested in this solution too, so that I can copy HTML-formatted text to a Microsoft Word document. Did you manage to get this working for Christine? Happy to continue discussion by email if that’s preferable. Thanks for your help.

      2. Hi,

        I’m bit confused about Christine word. What is the meaning of this? In which context you want to use the plugin.

        We’ll discuss here as well. But if it’s something non public information or long threaded information then we’ll discuss over email.

Leave a Reply