Hướng dẫn chống copy trên WordPress đơn giản, hiệu quả

Hướng dẫn sử dụng code chống copy cho website wordpress

Bước 1: Đăng nhập vào trang quản trị website WordPress mà bạn đang quản lý.

Bước 2: Tại phần Giao diện, click vào Sửa giao diện.
Bước 3: Nhấn vào file header.php
Bước 4: Sao chép toàn bộ code dưới đây, sau đó,i chèn vào phía trên thẻ đóng </head> khối code. Sau đó nhấn Cập nhật tập tin.
Mã code:
body {
-webkit-touch-callout:none;
-webkit-user-select:none;
-khtml-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
}
</style>
<style>
body {
-webkit-touch-callout:none;
-webkit-user-select:none;
-khtml-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
}
</style>
<scripttype="text/javascript">
//<=!=[=C=D=A=T=A=[
document.onkeypress=function(event) {
event= (event||window.event);
if (event.keyCode===123) {
//alert('No F-12');
returnfalse;
}
};
document.onmousedown=function(event) {
event= (event||window.event);
if (event.keyCode===123) {
//alert('No F-keys');
returnfalse;
}
};
document.onkeydown=function(event) {
event= (event||window.event);
if (event.keyCode===123) {
//alert('No F-keys');
returnfalse;
}
};
functioncontentprotector() {
returnfalse;
}
functionmousehandler(e) {
varmyevent= (isNS) ?e:event;
vareventbutton= (isNS) ?myevent.which:myevent.button;
if ((eventbutton===2) || (eventbutton===3))
returnfalse;
}
document.oncontextmenu=contentprotector;
document.onmouseup=contentprotector;
varisCtrl=false;
window.onkeyup=function(e){
if (e.which===17)
isCtrl=false;
}
window.onkeydown=function(e){
if (e.which===17)
isCtrl=true;
if (((e.which===85) || (e.which===65) || (e.which===88) || (e.which===67) || (e.which===86) || (e.which===83)) &&isCtrl===true){
returnfalse;
}
}
isCtrl=false;
document.ondragstart=contentprotector;
//]=]=>
</script>
Bước 5: Lúc này, bạn nhấn F5 để reload trang thì sẽ thấy toàn bộ bài viết của bạn đã được bảo vệ (người khác sẽ không thể bôi đen văn bản, right click, cũng như không lấy được hình ảnh trên trang web nữa), vậy là bạn đã thực hiện xong 5 bước chống copy trên WordPress.
Chúc các bạn thành công nha!
Nguồn: fb Mạnh Tú
Có thể là hình ảnh về đang ngồi

Post a Comment

Previous Post Next Post