Skip to content

Add “Read more” links to text copied from your website

G11th October 2011

C22 Comments

TJavaScript

Add a Tynt-style “Read more” link when people copy text from your website.

In 2009, a company called Tynt introduced a free service whereby website owners can add a “Read More” link to the bottom of text copied from their web pages.

Utilising a simple JavaScript, the controversial copy-paste modification utility works as follows:

  1. A user highlights some text on a web page and copies it, either by pressing Ctrl + C or via the browser menu.
  2. The Tynt JavaScript records the text that has been copied and sends it to Tynt for analytical/statistical purposes on behalf of the website owner.
  3. The Tynt JavaScript adds a “Read more” link to the bottom of the clipboard buffer containing the page URL, plus a unique code. (For example: “Read more: http://code.adonline.id.au/add-read-more-links-to-copied-text/#ixzz1aSokO3X3″
  4. When the user pastes the text, the “Read more” link is appended to the end.
  5. If the copied text is inserted into an email or reposted on another website verbatim and people click on the link, data will be sent to Tynt tracking the re-published information.
  6. Tynt forwards usage data to the website owners, who gain a better understanding of what content visitors are interested in.

The Tynt service seems to be very popular with newspaper and publishing websites where plagiarism could be a concern.

Implementing a “Read more” script on your site

If you want site analytics, you can sign up with Tynt.

Otherwise you can set-up your own Tynt-style “Read more” script that doesn’t rely on third parties. This solution doesn’t provide analytics nor use Tynt code. Rather it’s a simple implementation that provides a “Read more” hyperlink at the bottom of text copied from your website.

Several scripts have been written to add this function to websites, but I have been unable to find one that works on both Internet Explorer and non-IE browsers.

The solution I have found is to add two scripts to each page; one for Internet Explorer and one for Firefox/Chrome/Safari/Opera. (Combining these scripts into a single .js file breaks functionality).

Step 1: Get jQuery

The script for use on Internet Explorer requires the jQuery JavaScript library. If your site isn’t using jQuery, download the latest minified ‘production’ script, upload it to your server and add the following link to your <head>.


If your site already utilises jQuery, ignore this step.

Step 2: Download the JavaScript files

Unfortunately two scripts are required to provide function in Internet Explorer and non-IE browsers. They do work well in tandem:

You can download the scripts for use from their respective sites. To make things easier and ensure scripts load faster, I have minified them and bundled them into a single ZIP file which you can download here:

copytext.zip

Step 3: Site implementation

Unzip the file, and upload the two files to your website via FTP. Then ensure the following code is added to the page <head>:


 
 

It’s essential that the reference to your jQuery script comes first.

Now when you copy and paste text from your website, you should see a “Read more” link at the bottom.

   

Comments:

22 responses to “Add “Read more” links to text copied from your website”

  • Written by TestShoot on 18 October 2011:

    Thanks Adam! I was looking for an alternative to Tynt, and this did the trick.

    The good news too is that for those enterprise people, you can add events and things like Omniture tags to the copy action. You can also break it out to add a special “read more” based on a content areas users may copy from. IE: for more recipes visit, learn more about the author at…

  • Written by mark82 on 6 November 2011:

    i have just downloaded Copy & Paste Hijacker from jquery’s
    and seems to be crossbrowser, so there is no need to have two separate js!

    • Written by Adam Dimech on 6 November 2011:

      Mark,

      Which browsers did you test Copy & Paste Hijacker in?

  • Written by mark82 on 7 November 2011:

    hi

    currently i have two computer.

    on mac it worked with safari, chrome and firefox.
    on windows7, i tried on internet explorer, chrome and firefox.

    i have tested it on demo page provided by plugin @ http://e.xplo.it/jquery/cp.html

  • Written by Adam Dimech on 8 November 2011:

    Hello Mark,

    Having studied the code, it appears it has been modified since I wrote my blog post on 11 October 2011. I agree, it now works in IE9 and Firefox 7.

    • Written by Jake Lanso on 31 May 2012:

      Please update this post. The plugins page at jquery.com has been down for a couple months now.

      Could you please edit the plugin so that it works for IE9 And Firefox?

  • Written by msnz on 22 November 2011:

    i downloaded the new Copy & Paste Hijacker but i dont now how to modify it.

  • Written by Santosh on 10 January 2012:

    I am trying to use Tynt is my website.. Hope it will work fine for my blog..

  • Written by Ali on 15 April 2012:

    I wish it was including images also (like when someone copied IMG url in your page.)

    And, I can’t find updated version of Copy & Paste Hijacker in jquery.com which mentioned by mark82. It’s a broken url. If you have that version, could you upload it here since IE code is not working nowadays.

    Thanks for nice post.

  • Written by Oliver on 12 May 2012:

    It is probably sufficient to add

    charset=”iso-8859-1″

    when including jquery.copytext.min.js to make it work in everything but Opera.

  • Written by William on 16 December 2012:

    Hey, great article. I have made something similar that you might like to check out. You can add anything you wish to the copied text, its a jQuery plugin found on code canyon.

    The link is: http://codecanyon.net/item/jquery-copy-inject/3537749?ref=awgeorge

  • Written by Naijafinder on 23 December 2012:

    Thanks it works well on http://www.naijafinder.com

  • Written by Kevin on 7 January 2013:

    Although not a way to prevent people from copying your content, this code clearly makes people think twice before they do.

    Therefore, I’m seriously thinking about getting my webmasters to implement this on my own website.

    Thanks for sharing the tip.

  • Written by pasaka on 16 February 2013:

    THANKS!!!!

  • Written by supermario on 19 February 2013:

    Script won’t work in IE 10

  • Written by Vo Khanh Thuy on 10 October 2013:

    thanks!

  • Written by John on 23 January 2014:

    I wanted to try this but noticed that Copy & Paste Hijacker v.1.9.1 by dynamicplus is no longer available online. Fortunately Adam provided a zip containing the files. I installed these files and it worked perfectly on IE 10, Firefox and Chrome.

    Thanks Adam!!

Have your say:

The following HTML is permitted:
<a href="" title=""> <b> <blockquote cite=""> <code> <em> <i> <q cite=""> <strike> <strong>

Comments will be published subject to the Editorial Policy.