Performance snippets

Strip out scripts, requests and database work your site doesn't need, so pages load faster.

Showing 30 snippets

Performance PHP Tune or Turn Off Speculative Loading Make WordPress prerender pages as visitors hover over links for near-instant navigation, or turn speculative loading off. Intermediate WP 7.1 Performance PHP Delete Old Spam Comments Automatically Permanently delete comments that have been marked as spam for more than 15 days, in daily batches. Intermediate WP 7.1 Performance PHP Stop a Large Option From Autoloading Turn off autoloading for big options that WordPress loads on every request but rarely needs. Intermediate WP 7.1 Performance PHP Load Block Styles Only for Blocks on the Page On classic themes, load each block's CSS only when that block is used, instead of one big stylesheet for every block. Beginner WP 7.1 Performance PHP Add Cache Headers for Logged-Out Visitors Let your CDN and browsers cache public pages for a few minutes, while keeping logged-in users, carts and checkout uncached. Intermediate WP 7.1 Performance PHP Delete Old Post Revisions Automatically Remove post revisions older than 90 days with a daily scheduled task, keeping the database lean without losing recent history. Intermediate WP 7.1
Want it without code?Our plugins do the heavy lifting, with settings, updates and support.
Browse plugins
Performance PHP Empty the Trash Sooner Make WordPress permanently delete trashed posts, pages and comments after 7 days instead of 30. Beginner WP 7.1 Performance PHP Turn Off Site Search Return a 404 for WordPress search results on sites that don't use search, stopping bots from running expensive searches. Beginner WP 7.1 Performance PHP Remove the Recent Comments Widget’s Inline CSS Stop WordPress printing a block of inline CSS in the page head for the classic Recent Comments widget. Beginner WP 7.1 Performance PHP Load a Plugin’s Files Only on the Pages That Need Them Stop plugins like Contact Form 7 loading their CSS and JavaScript on every page when they're only used on one. Beginner WP 7.1 Performance PHP Log Page Loads Slower Than 2 Seconds Write a line to the PHP error log whenever WordPress takes more than 2 seconds to build a page, with the URL, query count and memory. Intermediate WP 7.1 Performance PHP Cache Expensive Queries in a Transient Store the result of a slow query, like a "most popular posts" list, for 12 hours and clear it automatically when posts change. Intermediate WP 7.1 Performance PHP Preload Your Main Web Font Tell the browser to download your main self-hosted font file early, so text appears in the right font sooner. Beginner WP 7.1 Performance PHP Control the Heartbeat API Safely Turn off the Heartbeat API for logged-out visitors and slow it down in wp-admin, without breaking autosave, post locking or login expiry warnings. Beginner WP 7.1 Performance PHP Change How Often the Editor Autosaves Make the post editor autosave every 2 minutes instead of every minute, to cut down on requests and revisions. Beginner WP 7.1 Performance PHP Replace WP-Cron With a Real Cron Job Stop WordPress running scheduled tasks during page loads, and run them on a schedule from your server instead. Beginner WP 7.1 Performance PHP Stop Sending Pingbacks When You Publish Stop WordPress contacting every site you link to and pinging update services each time you publish, which speeds up publishing. Beginner WP 7.1 Performance PHP Raise the WordPress Memory Limit Give WordPress more PHP memory for the front end and wp-admin, to fix "Allowed memory size exhausted" errors. Beginner WP 7.1 Performance PHP Cache Navigation Menus Store the HTML of large classic menus in the object cache, and clear it whenever a menu is saved. Intermediate WP 7.1 Performance PHP Don’t Lazy-Load Images Above the Fold Tell WordPress how many images at the top of each page to load straight away instead of lazily, to speed up your hero image. Beginner WP 7.1 Performance PHP Stop Generating Preview Images for PDFs Stop WordPress turning the first page of every uploaded PDF into a set of preview images, which saves upload time and disk space. Beginner WP 7.1 Performance PHP Disable the Emoji Script and Styles Remove the emoji detection script, inline styles and DNS prefetch WordPress adds to every page. Emojis still show using the visitor's own system font. Beginner WP 7.1 Performance PHP Preload the Featured Image and Preconnect to Key Origins Preload each post's featured image so it appears sooner, and open early connections to the outside origins your pages really use. Intermediate WP 7.1 Performance PHP Defer or Async Scripts the WordPress Way Load chosen scripts with defer or async using WordPress's built-in loading strategy, which respects script dependencies. Intermediate WP 7.1 Performance PHP Remove RSS Feed Links from the Page Head Remove the auto-discovery RSS and Atom feed link tags that WordPress outputs in every page head, along with the comment feed links. Beginner WP 7.1 Performance PHP Clean Up wp_head. Remove Unnecessary Link Tags Remove the wlwmanifest link, shortlink, adjacent post links, REST API discovery link, and oEmbed discovery tags that WordPress adds to every page head by default. Beginner WP 7.1 Performance PHP Remove jQuery Migrate on the Frontend Dequeue the jQuery Migrate script on the frontend for sites whose themes and plugins are compatible with modern jQuery, removing an unnecessary dependency. Beginner WP 7.1 Performance PHP Disable oEmbed Completely Remove WordPress's oEmbed endpoint, front-end script, and discovery links to prevent your site from being embedded elsewhere and eliminate unnecessary oEmbed-related requests. Beginner WP 7.1 Performance PHP Remove Dashicons When the Admin Bar Is Hidden Stop WordPress from loading the Dashicons font stylesheet on the frontend for visitors who aren't logged in, since Dashicons is only needed for the admin bar. Beginner WP 7.1 Performance PHP Skip Block CSS on Pages Without Blocks On classic and page-builder themes, stop loading the block library stylesheet on pages that contain no blocks. Intermediate WP 7.1

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only