How to Disable Copy Function In Blogger Blog

Many times it happened to me that somebody copied my contents. Most new bloggers copy other websites contents because they are not familiar with Google Algorithm like penguin and panda that are developed to remove sites that do not have original materials.

So, I am going to share a trick with you which is entirely related to protecting your blog contents from copying by disabling copy function.

I will share you Javascript and CSS code to disable copy buttons like Ctrl+A, Ctrl+ C and mouse copy functions. Visitors only can view the text but will never be able to copy it so it will help you to make your contents protectable.

In this tutorial, I am sharing two different way to disable copy function in BlogSpot blog.

How to Disable Copy Function with Javascript

1.Go to your Blogspot account and select blog where you want to disable copy function.

2.Click on Template>Edit HTML

3.Press Ctrl+F to open the Search box and then search for the following tag <head> in the HTML box. Paste all the javascript after the <head> tag and Save the template.

<!–Disabe Copy Paste Function—BV–>

<script language=’JavaScript1.2′>

function disableselect(e){

return false

}

function reEnable(){

return true

}

document.onselectstart=new Function (&quot;return false&quot;)

if (window.sidebar){

document.onmousedown=disableselect

document.onclick=reEnable

}

</script>

How to Disable Copy Function except in Blockquote

Bloggers like us sometimes share cool stuff with Blogspot members like widgets and gadgets in the form of codes like HTML/CSS/Javascript. They face that disabling function does not only allow readers to copy their text but also disallow to copy codes like HTML/CSS that they are sharing to then.

But with my little trick you can allow users to copy your codes by giving allow function in blockquote. It means that readers can copy everything which is within blockquote tag.

It is so simple to activate this function just search for that code ]]></b:skin> and paste the following CSS before this tag in Blogspot Template Editor.

/*—– Disable Text Selection with CSS Code— BV—-*/

.post blockquote {

-webkit-user-select: text !important;

-moz-user-select: text !important;

-ms-user-select: text !important;

user-select: text !important;

}

body {

-webkit-user-select: none !important;

-moz-user-select: -moz-none !important;

-ms-user-select: none !important;

user-select: none !important;

}

Or you can add this CSS to Layout by putting <style></style> before-after the code.

In the above CSS code, the first tag is allowing to select text within blockquote tag. You can also be able to disallow by removing post blockquote and its style codes or simply change the text to none. But you do not need that extra code.

If you want to disable copy paste and do not want to allow in blockquote then simply paste the above CSS code.

body {

-webkit-user-select: none !important;

-moz-user-select: -moz-none !important;

-ms-user-select: none !important;

user-select: none !important;

}

Now whenever you put Code in post give it blockquote style, and it will become selectable for readers only if you are using both CSS code.

If your blogger template use different post class like .post-body then change the .post blockquote into .post-body blockquote or if your template uses any other class then replaces .post with it.

Note: Both codes can be removable from template simply by inspect element feature available in almost all browsers. However, it takes a long time to find these codes.

Muhammad Rizwan
 

My name is Muhammad Rizwan, and I am 16 years young self-called Blogger. I am a student of ICS and half-time blogger. I love to work on my website and sharing new things with worldwide peoples. I share blogspot tutorials, blogging tips, SEO tips, reviews and many other helpful articles on this blog.

Click Here to Leave a Comment Below 0 comments