Halloween Sale 15% off Ends in See the plans

Snippet Library

Performance snippets for WordPress

Snippets that make WordPress lighter and faster: remove emoji scripts and embeds, control the Heartbeat API, limit revisions and load scripts only where they are needed. For developers and site owners chasing better Core Web Vitals.

1–24 of 92 snippets

  • PHP Performance

    Auto-Drafts and Trash Cleanup Tool

    Adds Tools > Clean Up Drafts and Trash with counts of leftover auto-drafts, trashed posts and trashed or spam comments, and a button to remove them all permanently after confirmation.

  • PHP Performance

    Autoloaded Options Inspector

    Adds Tools > Autoloaded Options showing the total size of options WordPress loads on every page and the 40 largest ones, with a button to stop autoloading any option that does not need it.

  • PHP Performance

    Cache Public REST API Responses for Visitors

    Stores the responses of public GET requests to the REST API (such as post lists used by headless front ends and block widgets) for a few minutes for logged-out visitors, and clears the cache when content changes.

  • PHP Performance

    Cache Site-Wide Comment Counts

    Stores the comment totals that WordPress shows in the admin menu, toolbar and dashboard for 10 minutes, avoiding a slow counting query on every admin page view on sites with many comments.

  • PHP Performance

    Cache-Busting Versions Based on File Changes

    Replaces the version number on your theme's and plugins' CSS and JavaScript URLs with the file's last-modified time, so browsers and CDNs cache files for a long time but always fetch a fresh copy right after you change one.

  • PHP Performance

    Clean Up the Page Head

    Removes rarely used tags from the page head: RSD, Windows Live Writer manifest, shortlink, adjacent post links and the REST API discovery link.

  • PHP Performance

    Clear the Embed (oEmbed) Cache

    Run on demand to delete every cached embed (videos, tweets and other oEmbed results) from the database, so they are fetched fresh and stale or broken embeds disappear.

  • PHP Performance

    Click-to-Load Google Maps Embeds

    Replaces embedded Google Maps in your content with a placeholder that loads the map only when clicked, for faster pages and fewer third-party cookies.

  • PHP Performance

    Click-to-Play YouTube Embeds

    Shows a lightweight thumbnail instead of the full YouTube player until the visitor clicks play, saving around a megabyte of scripts per video.

  • PHP Performance

    Database Table Sizes and Optimize Buttons

    Adds Tools > Database Tables listing every table of your site with its row count, data and index size and reclaimable space, sorted by size, with an Optimize button for tables that need it.

  • PHP Performance

    Defer Selected Scripts

    Adds the defer attribute to the front-end scripts you list by handle, so they no longer block page rendering.

  • PHP Performance

    Delete Image Size Files No Longer Registered

    Adds Tools > Unused Image Sizes, which finds resized copies of your images made for sizes your current theme and plugins no longer register, shows how much space they take, and deletes them in batches after confirmation.

Have a snippet worth sharing?

Publish it to the library from WPIDE or right here. Sign in with any WordPress site that runs WPIDE, free or Pro. Public snippets are reviewed by the WPIDE team before they appear.