Boosts performance of critical short JavaScript files by allowing to embed their code instead of linking to files. Script positions and extra scripts …
As of April 2026, Embed JavaScript File Content is a WordPress embed plugin with 10 active installations and a 0/5 rating0. It has been downloaded 1.1K+ times in total. Requires WordPress 4.1+ and PHP 5.4+. Available on WordPress.org since 2020. Last updated 5 years ago — may have compatibility concerns. Top alternative: EmbedPress – PDF Embedder, Embed….
In some critical cases you cannot wait for a JavaScript file to load. Then you can benefit from better performance, if you embed the JavaScript code directly into the <script> tag. This is where this plugin comes in: It provides a filter embed_javascript_file_content_handles, which takes JavaScript handles and echos their code content into the DOM instead of linking to a file.
Please beware that placing lots of embedded JavaScript code can be critical! First you lose caching benefits and second the document size can increase easily. A general rule of thumb is that you should only consider JavaScript files for inline placement, which are critical and which have a file size lower than ~500 Bytes.
add_action( 'wp_enqueue_scripts', 'my_scripts' );
function my_scripts() {
//…| WordPress | 4.1+ requiredTested up to 5.4.19 |
| PHP | 5.4+ required |
Plugin data sourced from WordPress.org. Analysis and metrics by PluginSift.