Wednesday 13 March 2019

How to Disable WordPress Plugins on Specific Pages and Posts


When it comes to WordPress performance, we have a lot to say about plugins. Each plugin adds PHP code that has to be executed, usually includes scripts and styles, and may even execute additional queries against the database. This means that unnecessary plugins can affect page speed and may have a negative impact on the user experience and your page ranking. As an example, consider a plugin that builds and displays custom forms on front pages, like Contact Form 7. Typically, you would only need one form on a single page, but ideally, you may want to embed a form on any page using the plugin’s shortcode. For this reason, Contact Form 7 loads scripts and styles on every page of your website.
But do you really want to run the plugin code and include scripts and styles on every page of your WordPress website?
In this post, I will show you how to prevent unnecessary plugins from loading on specific posts/pages, so that you can install additional plugins (don’t go crazy of course), and still have your WordPress website load fast. To accomplish this task, we’re going to disable WordPress plugins programmatically on specific posts and pages. This is a four-step process:
Choose
Source: https://managewp.org/articles/18448/how-to-disable-wordpress-plugins-on-specific-pages-and-posts



source https://williechiu40.wordpress.com/2019/03/13/how-to-disable-wordpress-plugins-on-specific-pages-and-posts-2/

No comments:

Post a Comment