Buy Plus UI v2.5! Demo Buy Now!

How to Prevent your Blog Articles from Copying with Simple Javascript Codes

Hello Blogger's how are you , I hope your are doing good and great. I am Sadab Ali and welcom again to Tech Aadi.

Copying content from your blog is very frustrating thing to be happened with you. And what after that you will send hi DMCA takedown or something.

Yes our topic is to prevent our blog articles from copy writing.

How to Prevent your Blog Articles from Copying with Simple Javascript Codes

But let me tell you one thing you can try this JavaScript and if anyone tried to copy your post then the souce code will automatically be copied from your blog.

So let's start the process of adding JavaScript in your blog for preventing it from Copying.

Before doing any change in your blog and template please backup your blog template for any kind of errror and easy restoration process.

Adding JavaScript for Preventing Blog from Copying

You have to only Add JavaScript in your blog so please follow the below given step carefully.

Adding JavaScript

  1. Go to your Blogger dashboard.
  2. Click on themes section.
  3. Then click on Edit HTML.
  4. Now search for the </body> tag.
  5. Copy the below given JavaScript and paste it just above the </body> tag.
<script type="text/javascript">
function addLink(){
    var body_element = document.getElementsByTagName('body')[0];
    var selection;
    selection = window.getSelection();
    var pagelink = "<br/><br/>Article Source : <a href='"+document.location.href+"'>"+document.location.href+"</a>";
    var copytext = selection + pagelink;
    var newdiv = document.createElement('div');'absolute';'-99999px';
    newdiv.innerHTML = copytext;
    window.setTimeout(function() {
document.oncopy = addLink;

Now click on Save Theme.

That's all. Now copy any content from your blog and paste it somewhere you will see the results or you can view the demo.

You can also copy any word from this article and paste it anywhere you can see the source code URL of my blog automatically pasted below there.

After completing above steps I hope you have successfully installed the script for preventing your blog from Copying. If you get any error kindly contact us.


So today we have discussed about How to Prevent your Blog Articles from Copying with Simple JavaScript codes. I hope you liked our blog and please do follow our blog for more updates. If you have a query please comment below.

Read also :

Rate this article

Getting Info...

About Post Author

Cookies Consent

This website uses cookies to ensure you get the best experience on our website.

Cookies Policy

We employ the use of cookies. By accessing Plus UI, you agreed to use cookies in agreement with the Plus UI's Privacy Policy.

Most interactive websites use cookies to let us retrieve the user’s details for each visit. Cookies are used by our website to enable the functionality of certain areas to make it easier for people visiting our website. Some of our affiliate/advertising partners may also use cookies.