Script Logic is a WordPress plugin that lets you control on which pages scripts and style sheets load using WP’s conditional tags. This plugin lists all JavaScripts and Style sheets with a control field that lets you control CSS & JavaScript files to include only on the pages where you actually need them. The text field lets you use WP’s Conditional Tags, or any general PHP code. NOTE: The script logic you introduce is evaluated directly. Anyone who has permission to manage options will have the right to add any code, including malicious and possibly destructive code. There is an optional filter ‘script_logic_eval_override’ which you can use to bypass the EVAL with your own code if needed. (See Other Notes). On plugin configuration page you see all script and CSS files with a logic field. Lets suppose you are using Contact Form 7 plugin. You created a page Contact Us (slug = contact-us) and want to include Contact Form 7 scripts only on this page. Find the Contact Form 7 scripts on plugin’s configuration page (they have handle = contact-form-7) and put `is_page(‘contact-us’)` in logic field Lets suppose you are using Contact Form 7 plugin. You created a page Contact Us (slug = contact-us) and want to include Contact Form 7 scripts only on this page. Step 1: Step 3: Introduction
Installation
Configuration
Usage Example
Find the Contact Form 7 JS and CSS on plugin’s configuration page (they have handle = contact-form-7).
Step 2:
Put is_page('contact-us') in logic field
Dance! You just excluded 2 files from all pages except your contact us page making your site load faster!!!
Script Logic Plugin
Introduction Script Logic is a WordPress plugin that lets you control on which pages scripts and style sheets load using WP’s conditional tags. This plug
Work with Scriptbaker
Let's talk about your project
Whether you're extending an existing platform, modernising legacy code, or planning something new, our engineers can help. Tell us what you're working on and we'll explore a practical technical solution together.
Related posts
WordPress
Adding Custom Fields to WordPress User Profile Page
Learn how to add custom fields to the WordPress user profile and Add New User screens using WordPress action hooks. This guide shows how to create, display, sanitize, and save custom user fields such as company name with user metadata.
WordPress
Multi Image Upload
Multi Image Upload adds a meta box to upload multiple images for posts and pages. You can enable it for custom post types also. Download: http://wordpress.org/p
WordPress
Install WordPress Plugins Without FTP Access
Learn how to install WordPress plugins without FTP access. This updated guide explains why WordPress requests FTP credentials, how to fix filesystem permissions and ownership, when to use FS_METHOD, and how to troubleshoot common installation errors safely.

