How To Show Your Blog Post Link Automatically When Someone Copy Your Blog Post In His/Her Blog

In the last few weeks i have noticed that famous Websites (such as Droidadda, Techcrunch,  Huffington Post) now have a “read more” link on any text that is copied and pasted from their site. This can be a good way to get new visitors to your site as many people will copy and paste text from websites into an email. People also often save information for future reference, or just share it with friends, family or colleagues. There are a few ways to do this, and in this article we are going to show you how.

1. Tynt

Tynt is a hosted solution which requires you to sign up and Tynt will create a code to insert onto your website. It is also available in a WordPress plugin: Tynt WP Plugin. Tynt also offer analytics on users coming to your site via these pasted links.
Although this service does appear to work well and is easy to setup, we do not really recommend this method based on the comments on this page.

2. Javascript 

  • For Bloggers

You can copy and paste the below javascript into the >head< section of your page.


//
function addLink() {
    if (
window.getSelection().containsNode(
document.getElementsByClassName('entry-content')[0], true)) {
      var body_element = document.getElementsByTagName('body')[0];
    var selection;
    selection = window.getSelection();
    var oldselection = selection
    var url = document.URL
    var pagelink = "
   Read more at The Web Taylor: PAGE TITLE HERE " + url + ""; // Change this to suit
    var copy_text = selection + pagelink;
    var new_div = document.createElement('div');
    new_div.style.left='-99999px';
    new_div.style.position='absolute';
      body_element.appendChild(new_div );
    new_div.innerHTML = copy_text ;
    selection.selectAllChildren(new_div );
    window.setTimeout(function() {
        body_element.removeChild(new_div );
    },0); } }
document.oncopy = addLink;
// ]]>
  • For WordPress Users

Or if you are using WordPress, copy and paste the below code into your functions.php file.


function add_copyright_text() {
if (is_single()) { ?&gt;
//
function addLink() {
    if (
window.getSelection().containsNode(
document.getElementsByClassName('entry-content')[0], true)) {
    var body_element = document.getElementsByTagName('body')[0];
    var selection;
    selection = window.getSelection();
    var oldselection = selection
    var pagelink = "
 Read more at The Web Taylor: '>"; // Change this to suit
    var copy_text = selection + pagelink;
    var new_div = document.createElement('div');
    new_div.style.left='-99999px';
    new_div.style.position='absolute';
    body_element.appendChild(new_div );
    new_div.innerHTML = copy_text ;
    selection.selectAllChildren(new_div );
    window.setTimeout(function() {
        body_element.removeChild(new_div );
    },0);
}
}
document.oncopy = addLink;
// ]]>
<!--?php <br ?--> }
}
add_action( 'wp_head', 'add_copyright_text');

Final Words

This article has been written for the seek of those users who spent hours on writing a blog post and the copy cats stole their work in minutes by just copying the whole post. Now fell free youl post will be copied along with your post like. If the copy user removes your blog post link the copy contents won't appear on his blog 😉

via Blogger http://www.droidadda.org/2017/03/how-to-show-your-blog-post-link.html https://mtkdr0id.files.wordpress.com/2017/03/67a2c-how-to-write-a-blog-post-when-you-dont-want-to.png?w=300

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s