Use the selector .wp-admin to make sure you are selecting only the wordpress admin area.
html body.wp-admin {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
The code above will prevent the user from selecting/highlighting the page content.
If you really want to disable right click, just use a simple JS code like:
<script>
document.oncontextmenu = new Function("alert('Right click is blocked.'); return false");
</script>
References:
Related Posts:
- How to use my menu PHP code as sidebar?
- Change plugin name on WordPress repo
- Using wpdb without loading all plug-ins via wp-load.php
- Know which plugin is calling JS in wp_head()?
- Are plugins instantiated on every request to WordPress?
- WooCommerce Force Display of Base Country Order Addresses
- Security and Must Use Plugins
- Why shortcode always displayed after footer not in body
- adding a button to the media uploader
- Get path to themes CSS file inside of a Plugin
- how to activate a plugin inside a theme
- Add some fileds to the wp_posts table
- Add text to variable
- How do I add $_SESSION[”] to my wordpress page?
- There has been a critical error on your website – won’t fix no matter what
- Get orders of a specific customer woocommerce
- What am is missing? (API CORS)
- How to find out which plugin create captcha after login?
- Plugin Activation Error – The plugin generated 22 characters of unexpected output during activation
- All in One SEO Pack error message
- How to fix broken media library?
- Deactivated Visual Composer plugin, site crashed, what to do? [closed]
- JQuery needs to be defined in , but Gravity Forms is defining it in the
- Does Deactivating a Plugin Help Anything?
- The add_action(‘register_form’) isn’t effecting my registration form
- override function from my plugin [closed]
- Plugin hook not working on specific WordPress installation – how to troubleshoot?
- Add Stack Exchange Recent Questions to a wordpress sidebar?
- WordPress Membership Plugin Advice [closed]
- How to hide plugin options for editors via functions.php
- WordPress Stats Plugin: Display Post Views [closed]
- Pagination not working
- Hook for plugin to insert into entry-meta
- Installed WordPress.com Stats with api key and forgot key. How can I register w/ new key?
- Shopp Plugin Remove Quantity Dropdown [closed]
- jQuery slider widget similar to cnet.com
- Custom content plugin for front page in wordpress
- Bulk User Deletion
- In Multisite Setups, how to update mass sections of sub-sites
- Using file_get_contents within admin but keep logged in
- need to find duplicated meta value in custom filed and view the posts that have the same value
- Woocommerce plugin – How to create two versions of the same plugin with slightly different implementation for different users
- Bookmarking custom template pages which all have the same page ID
- Push Contact form 7 variable to front end after submission
- Add a parameter at the end of the url and prettify
- Moving all wordpress posts from 50 websites to another website
- Is there any known plugins that would replace WordPress classes in editor with their Bootstrap 4 equivalent?
- Share my WordPress plugin for updating how?
- How can I change page content for good once a button is pressed?
- Google Maps for Woocommerce Checkout
- Add two row of code to the public static function init of a plugin
- Add spacebar in WP List Table Search
- Error after installing the WordPress plugin updates
- Plugin to manage form submissions on admin panel
- Trying to remove a couple categories from shop page
- Enabling plugin on specific pages and subpages
- Product slider not showing when clicking on tabs
- Custom plugin issue – Notice: Trying to get property of non-object in
- jquery plugin won’t fire when hamburger class element clicked
- fetch price from different table woocommerce
- WordPress show descriptions under images in gallery
- Cannot save a custom meta field in quick edit
- Widget display in theme
- Can i add custom code in Source in specific page, Header from function.php?
- Permission Issues regarding Plugin updates & FTP transfers
- ACF Query result in a new td (echo)
- Delete user meta based on key value that is an array
- Hook on widget context plugin to add custom context for widget
- Plugin to Delete All Posts Monthly
- How to write wordpress plugins faster to load?
- mailjet plugin – extend functionnalities and reuse api
- Using permalinks with parameters
- How to add featured image on front end form?
- Can’t get paramaters from url page of content
- plugin not working for adding post to page
- Put folder in theme via plugin
- Plugin menu replaced by another plugin?
- How to use Repeater field of advance custom field
- WordPress plugins not showing after switching servers
- Creating fields in the database
- Scrolling Ads? Live scrolling widget, not random on refresh
- Output dropdown results into Woocommerce Order details
- How to manually remove preload fonts settings in WordPress?
- How to block external download link access if visitor not referred from WP?
- From a legal perspective, is it okay to customize a plugin’s code?
- Display products based on sub-categories
- woocommerce add variable after price
- How to skip woocommerce PayPal redirection?
- Auto Stock Update after Order cancel from Admin of Woocommerce?
- Notifications Bar on home page only
- how to embed a crop feature for cropping images uploaded by the user
- Render CMB2 select option to post page [closed]
- Footer option is missing in Customiser
- How can JavaScript code be added before the closing HTML body tag?
- Is Nonce Verification (CSRF) required for WordPress Custom Bulk User Actions?
- plugin development code standard not matching for SQL query
- Ajax response from Media Selection does not update ALL information more than once
- PHP Deprecated function Optional parameter $function
- Missing Contact Form/Form Default Plugin in WordPress
- Plugin for better Backend Search? [closed]