If you want to defer loading of css, see CSS delivery optimization: How to defer css loading?.
If you want to defer loading of js, you can use this:
add_filter( 'script_loader_tag', function( $tag, $handle ) {
return str_replace( "<script type="text/javascript"",
"<script type="text/javascript" defer="defer"", $tag );
}, 10, 2 );
Related Posts:
- Improving the perfomance of a plugin action
- Do deactivated plugins slow down a WordPress site?
- How to export comments in WordPress?
- How can I call a function from one plugin within another plugin?
- Gutenberg disallow certain custom blocks but keep all core blocks?
- Remote upload file to server B
- Publish author posts only with editor approval?
- Using functions from a plugin in your theme
- Keep one user logged for a year?
- Customizing subject in comment notification e-mails
- WP showing “warning: call_user_func_array()”, What to do?
- Declare a function before plugin does on the theme functions.php file
- Generate Advanced Custom Fields box in custom admin menu page
- How to turn off email you receive when registered?
- Removing user contact methods works from functions.php but not from a plugin
- Execute a function using ajax
- Use functionality of 2 wordpress plugins
- How can i change an image’s author?
- Converting a simple plugin to be placed inside of functions.php
- Set WordPress Featured Image For All Post Slugs Matching Image File Name in Specified Directory
- Showing Co-Authors on post page
- jQuery Plugin to use WordPress functions in AJAX request
- greatest() function returns undefined property
- Debugging Technique Question re: functions.php
- The Point of Using apply_filters()
- WP Job Manager Category Drop-down; Change Placeholder Text Via Filter
- How to get subscription key or id using Woocommerce Subscriptions [closed]
- How to include code into functions.php file via a plugin
- Custom Taxonomy Tag Search
- Redeclare theme’s function in a plugin
- I have functions in my wordpress plugin. How do I get them to work for me?
- Change wordpress current_time function to different timezone
- How to override a plugin function wrapped in a class?
- Edit Yoast SEO breadcrumbs output [closed]
- Snippets: is it better to add them in functions.php or make site-specific plugins?
- Using a post-signup hook to get user details
- Restrict media upload size by format
- Calling plugin function inside custom plugin for onclick event
- Show function to super admin
- Will Gutenberg Have a Negative Impact on Page Speed?
- Facebook Messager Plugin
- All sites themes functions.php have been changed
- Plugin is a widget, but I want to call it in the head, can I?
- Cannot get wpdb data (Error in a simple fuction) [closed]
- What are the performance hiccups when building plugins?
- Basics of changing plugin output
- Why can’t I call a (member) function from within a foreach?
- Are there action hooks for comments?
- Help with WP Business Directory Manager Plugin?
- Shortcode Attributes to Return different $_POST
- Plugin onclick button activate other plugin
- Loading a plugin’s js file from functions.php
- Activate and deactivate plugin automatically
- dynamic name of the style for wp_enqueue_style
- WordPress function to add text warning on every pages [closed]
- How to access OOP plugin function inside themes or other plugin
- Different registration form for different roles
- Call javascript functions from each page
- Add_image_size not generating correct size
- Elementor Pro display featured image on section -> style -> image using shortcode
- How can i call a functions.php function, from inside my plugin class?
- How to make WooCommerce payment method field optional?
- Create a pdf from the entries in DB
- RSS feeds for specific topics
- WordPress Custom Hook with Class method
- Allow a particular user to access a particular plugin?
- How to remove Unused CSS From a WordPress Theme?
- how to define a html folder to make it work with WordPress commands
- add a hook of Woocommerce to a plugin but it only shows and doesn’t function properly
- ACF Fields are not showing up on Homepage
- Adding discount functionality to the cart
- Use buddypress function outside of plugin
- Securing langugae folder
- WPML – Hook when language is switched (change user language)
- Call function with button and return response
- Use action, filter, or hook to append HTML to WordPress plugin function
- Return function results within shortcode
- Save Post Permalink In .txt File
- Why is WP template_include overwritting all templates rather than specified page?
- How To Add Code To WP Without Plugin or Functions
- Disqus comments count taking long to update
- plugin not hooking to my custom hook
- Populate select option with JSON file
- Home page letters
- Find all strings between an enclosing shortcode
- API calls on plugin activation or init?
- Load wordpress enviroment for external content?
- How to structure plugin in to functions?
- Trying to output a “Most visited blogs” list in wordpress multisite
- How to disable register and reset the password from WordPress admin panel?
- wordpress Search function is not working
- What is wrong with this dbDelta syntax?
- Call a function with href
- Eliminate Render blocking CSS?
- Adding a script & php to functions.php
- PHP Creating a formula from mysql db values and db stored math operator
- Make plugin admin page visible to other roles
- Sort posts by Date (DESC) and by ACF: active_inactive (ASC)
- wp_enqueue_script doesn’t load JS in plugin
- How can i store cache of wordpress a database request without plugins?