Replace the /your-page-slug/ with your desired page where you want to disable the plugin and plugin-folder/plugin-main-file.php is plugin directory and plugin main file name with .php extension.
add_filter( 'option_active_plugins', 'the_dramatist_disable_plugin_on_certain_page' );
function the_dramatist_disable_plugin_on_certain_page($plugins){
if(strpos($_SERVER['REQUEST_URI'], '/your-page-slug/') === FALSE && strpos($_SERVER['REQUEST_URI'], '/wp-admin/') === FALSE) {
$key = array_search( 'plugin-folder/plugin-main-file.php' , $plugins );
if ( false !== $key ) unset( $plugins[$key] );
}
return $plugins;
}
Hope this piece of code help you.
Related Posts:
- Get a list of all registered actions
- How can I force a file download in the WordPress backend?
- How to implement a customizable free OpenID authentication?
- What’s a reliable way to depend on another plugin?
- Woocommerce – Hide “add to cart” on free products
- WordPress apply_filters() Arguments Missing
- How to hide /wp-content/uploads/ from URL?
- Add image to post from external URL
- User profiles and object associations
- Generate Advanced Custom Fields box in custom admin menu page
- Share buttons on article footer
- WordPress plugin search does not work and updates are not shown, VPS install
- How to prepend to the_title for admin-side plugin’s use
- Gutenberg: Difference between “import” and “const” for dependencies
- Custom data-id wp_enqueue_script
- Settings API – input always updates over validation
- Creating search filter through plugin
- Should I host support forum on wordpress.org or my own website?
- How to setup a Network Plugin across the network with only my settings?
- jQuery Plugin to use WordPress functions in AJAX request
- Is it possible to insert images directly from the server?
- Can a plugin deactivate itself?
- “Members only” section of a WordPress site – self signup and no backend access
- I wrote my plugin. How to display the result of the plugin’s function to sidebar (widget?)?
- I have functions in my wordpress plugin. How do I get them to work for me?
- Get IDs of Images from Gallery Block in InnerBlocks of a Custom Gutenberg Block
- mysqli_error() expects parameter 1 to be mysqli, null given in own db class
- How to embed HTML code from WP Coder plugin (or other) into Main Index Template of the theme
- Which escape function to use when escaping an email or plain text?
- Adding widgets to header and footer from plugin
- SEO smart plugin not working for words ending with ä, ö, å
- resetting permalinks after changing page names
- Edit Yoast SEO breadcrumbs output [closed]
- WordPress WPforms customization
- Admin accounts unable to see plugins from external IP
- WP ALL Import plugin – import data from certain ids
- Where these .js file come to source code?
- How to remove plugin metaboxes from edit.php
- creating a custom shop page display on archive woocommerce
- How to add FB like + share AND also other Social Buttons on ALL pages and posts?
- file-gallery plugin line 1573 broken in 4.2 upgrade [closed]
- the_tags : can we insert a class
- PHP Error When a plugin is active
- Errors when trying to use a plugin to write to the database
- Completely disabling password reset/recovery
- How to load different homepage on Mobile.?
- WordPress REST API Plugin Development – Add Custom Endpoint
- how to prevent all css and javascripts files from loading
- Hook into the rendering of a WordPress Template
- Best way to count visitors?
- WPTouch – how to remove shortcodes or make shortcodes function
- Adding class to last list item? Not WP generated
- I changed .live() to .on() but change is not reflected on the server
- Trying to add a page template for my custom post type from a plugin, but it will not display in the template dropdown unless file is in theme
- How do I set up XAMPP to allow me to download plugins and themes?
- Dequeue, Unregister, Remove Action – Not Working on Plugin
- HTTP requests start hanging after I try activating all plugins, and only stop when I manually disable the plugins via DB
- Memory Management when developing plug-ins
- How can recognize post’s category?
- Developing plugin, where to place action hooks etc?
- Widget content turns up before title
- Load script only in the admin page
- Using AJAX to run SQL statement and populate dropdown
- How do I fill the Home Description?
- Disable “auto embed” feature when pasting text and links
- How to prevent users to view server files using WP File Manager plugin?
- Alternative Hook to the_content for Changing Background Color
- How to use WordPress header function and footer function and not load word press database
- SASS not showing in customized preloader plugin
- Lock content in WordPress website
- I want to display “how many times this tag used in WordPress?”
- After updating theme & plugin I am getting an error message
- Get Current Post ID in WP Loop For GiveWP
- Suspect incomplete .pot file – what to do?
- Password Protect wp-content?
- Unable to activate themes on localhost
- How to make cover image in post block expand to entire screen?
- Can you develop themes and plugins while using the hosting services BlueHost? [closed]
- Conditional Fields depending on checkboxes
- Identify if the_post hook is being called from the admin post list
- Translation plugin with default language?
- wordpress ajax pagination object value does not change
- Reorganization of namespaces
- Google analytic issue in wordpress
- image upload error wordpress
- Simply Exclude – Category feed exclusion is excluding from category feed instead of just the main feed
- OOP Plugin: Where should I place the action hooks in the class?
- How to get the real address from a url (permalink)
- 404 Page when emptying spam or deleting a plugin
- How to make temporary expiring link for a downloadable file
- Add country flags
- Content expands beyond its column container [closed]
- cURL External API request displays content above other content on page
- A way to upload old html pages with all its assets via WordPress admin and to add a fixed menu on top of those (a la Wayback Machine)
- admin_enqueue_scripts using hook_suffix vs GET page
- WordPress.Security.NonceVerification.Recommended
- My Revolution Slider suddenly appears two times after updating
- BBPress Customization with Custom Plugin
- WooCommerce Bookings – Last day of booking available for the next customer
- Custom Gutenberg blocks not showing in WP editor