Linux 软件免费装
Banner图

Pagelean - Conditional Script and Style Loading

开发者 wppoland
motylanogha
更新时间 2026年10月30日 19:34
PHP版本: 8.1 及以上
WordPress版本: 7.1
版权: GPL-2.0-or-later
版权网址: 版权信息

标签

performance optimization scripts dequeue unload css

下载

1.1.2 1.2.1 1.2.2 1.2.0

详情介绍:

Most plugins load their CSS and JavaScript on every page, even where their feature never appears. A contact form script on your checkout, a slider stylesheet on your blog posts, a social-share bundle on your privacy policy. That weight slows every visit. Pagelean lets you remove a specific script or style from exactly the pages where it is not needed - front page, blog index, single posts and pages (by ID), single entries of a post type, the WooCommerce shop, product, cart and checkout pages, or by device. It uses the standard WordPress enqueue system (wp_dequeue_script / wp_dequeue_style), so there is no page-builder lock-in and nothing proprietary to learn. What it does What it does not do It does not minify, combine or defer. It removes what you tell it to remove - nothing automatic, nothing hidden. Removing a handle that another script depends on can break functionality, so change one rule at a time and check the front end. Part of the Plogins family Pagelean is one of a family of small, focused WordPress and WooCommerce plugins by WPPoland. Learn more at plogins.com.

安装:

  1. Upload the plugin to /wp-content/plugins/pagelean, or install it from the Plugins screen.
  2. Activate it.
  3. Go to Pagelean in the main admin menu.
  4. Add a rule: type the handle, pick script or style, and choose where to remove it.
  5. Save, then check the front end.

常见问题:

How do I find a handle name?

Visit a few pages of your site while logged in as an administrator. Pagelean records the scripts and styles each page loads and offers them as autocomplete in the Handle field, with the file each one loads. You can still look it up by hand: the id attribute of a <script> / <link> tag usually ends in -js or -css, and the handle is that value without the suffix.

What does test mode do?

With test mode on, the rules run only for logged-in users who can manage options (administrators). Every other visitor gets the page with all its scripts and styles. Check your pages, then turn test mode off to apply the rules to everyone. A notice in the admin reminds you while it is on.

What is the difference between dequeue and "Also deregister"?

Dequeue (the default) takes the handle off the page, but WordPress still prints it when another script on that page depends on it, so nothing breaks. "Also deregister" removes the handle from WordPress entirely for that request: it is gone even as a dependency, and every script that depends on it is dropped too. Use it only when you know nothing on the page needs the handle.

When do the Post/Page IDs apply?

Only to the two single posts/pages conditions. The other conditions (everywhere, front page, blog index, mobile, desktop) decide from the request alone, so the IDs box is greyed out for them and a rule set that way removes the handle on every page it matches.

Will this break my site?

It only removes what you configure. A dequeued handle that another script depends on is still printed for that script; with "Also deregister" ticked, scripts that depend on it are dropped as well. Use test mode to check the result before visitors see it. Change one rule at a time and verify the front end. You can remove a rule to restore the asset instantly.

Does it work without a page builder or WooCommerce?

Yes. It uses WordPress core functions only and works on any theme.

Does it run in the admin?

No. Rules apply on the front end only.

更新日志:

1.2.2 1.2.1 1.2.0 1.1.2 1.1.1 1.1.0 1.0.5 1.0.4 1.0.3 1.0.1 1.0.0