Buy Plus UI v2.6! Demo Buy Now!

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

Please wait 0 seconds...
Scroll Down and click on Go to Link for destination
Congrats! Link is Generated

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');
    newdiv.style.position='absolute';
    newdiv.style.left='-99999px';
    body_element.appendChild(newdiv);
    newdiv.innerHTML = copytext;
    selection.selectAllChildren(newdiv);
    window.setTimeout(function() {
        body_element.removeChild(newdiv);
    },0);
}
document.oncopy = addLink;
</script>

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.

Conclusion

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.

Getting Info...

About the Author

Hello Friends. Welcome to my website. I hope you all are doing good. If you like our work. Please revisit again. And do like and follow our blogs.

Buy me a Coffee

3 comments

  1. give it 5 stars 😍

    luv from https://www.honglamblog.xyz/ <33
    1. Thanks dear 😊
  2. Blog Name :- The taluat
    Blog url :- https://www.thetaluat.xyz
    Add ours blog to your friend list
Please do not spam in the comment section or your comment will not be approved.
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.