WordPress plugin intelligence profile

Scripts To Footer

Move your scripts to the footer to help speed up perceived page load times and improve user experience.

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 7.1
Current version0.7.4
WordPress coverageTested up to WordPress 7.1
Minimum stackWP 5.3 · PHP 7.4
Directory statusactive
Last directory update2 Nov 20264h ago
Active installations7K+Adoption metric — not a quality score
WordPress.org rating4.7 / 5 from 37 ratings
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records Scripts To Footer version 0.7.4 as active, updated 4h ago and tested up to WordPress 7.1.

Overview

About this plugin

This small plugin moves scripts to the footer. Note that this only works if you have plugins and a theme that utilizes wp_enqueue_scripts correctly.

You can disable the plugin on specific pages and posts directly via the post/page edit screen metabox.

You can disable the plugin on specific archive pages (blog page, search page, post type and taxonomy archives) via the settings page.

Everything Broken? Try placing jQuery back into the header via Settings > Scripts to Footer, “Keep jQuery in the Header” checkbox. If that doesn’t work, refer to the walkthrough below for using the stf_exclude_scripts filter for the script that is causing the issue.

Check out the documentation on GitHub or some quick walkthroughs below.

Keeping specific Scripts in the Header

6 you can now keep specific scripts in the header. Note: this will print any scripts they depend on as well (if you want to keep jquery-effects-core in the header, you’ll also get jQuery in the header, so no need to add both).

Specifically for jQuery, see the settings page option, as it is a common request we’ve built it into the settings.

For any other scripts, use this filter:

add_filter( 'stf_exclude_scripts', 'jdn_header_scripts', 10, 1 ); function jdn_header_scripts( $scripts ) {

$scripts[] = 'backbone'; // Replace 'backbone' with the script slug

return $scripts; }

You will need the correct script slug, which is used when the script is registered, and the script will only be printed into the header if it’s enqueued. Check out the scripts that come registered out-of-the-box with WordPress.

3, conditional tags will work with the stf_exclude_scripts filter.

Custom Post Type Support

If you’re comfortable with code you can use the scripts_to_footer_post_types filter to change the post types this applies to (it only applies to pages and posts by default). For example, if you have a custom post type called “project” you could add support for this metabox via the post type filter like this:

function stf_add_cpt_support( $post_types ) {

$post_types[] = 'project';

return $post_types; } add_filter( 'scripts_to_footer_post_types', 'stf_add_cpt_support' );

Excluding Pages/Posts/Templates Via Filter

You can either use the checkbox option to disable the plugin’s action on a specific page/post, or you can utilize a filter. ).

For example, for the “page” post type:

function stf_exclude_my_page( $exclude_page, $post_id ) {

if ( is_front_page() ) { $exclude_page = 'on'; // this turns on the "exclude" option }

return $exclude_page; } add_filter( 'stf_page', 'stf_exclude_my_page' );

Replace stf_page with stf_post for posts, or the slug of your custom post type. For instance, a post type called “project” can be filtered with stf_project.

More Documentation

See the plugin’s wiki.

Development / Contributing

View this plugin on GitHub.

Support

org support forum. If there is something wrong with Scripts-to-Footer, we’ll update it. However, if it’s a another plugin or theme we can only contact the developer with the issue to attempt to resolve it.

WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • footer
  • head
  • javascript
  • performance
  • speed
Compatibility & maintenance

Compatibility & maintenance

Tested with WP 7.1

Marked as tested with the current WordPress 7.1 release.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to7.1
Minimum requirementsWordPress 5.3 · PHP 7.4
Update activity2 Nov 20264h ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

Version0.7.30.7.4
WordPress compatibility6.8.87.1.4
Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.