Can you try this, it was what I tried to explain in my comment. Again, this is just a guess.
function js_async_attr($tag){
// Add async to all remaining scripts
return str_replace( ' src', ' async="async" src', $tag );
}
add_filter( 'script_loader_tag', 'js_async_attr');
function remove_js_async_head(){
// function to add async to all scripts
remove_filter( 'script_loader_tag', 'js_async_attr');
}
add_action( 'wp_head', 'remove_js_async_head', 100);
Related Posts:
- Clean-up script tags
- remove empty paragraphs from the_content?
- Issues with title-tag and document_title_parts
- Remove Actions/Filters added via Anonymous Functions
- Set JPEG compression for specific custom image sizes
- Define custom Page Template without its own .php file
- Add class to menu items of one specific menu (nav_menu_css_class)
- How to influence the information displayed on widget inside wp-admin
- Where and how to put inline js in pages
- Removing default image size list in Media Box
- Does WordPress Development Mode Exist (with not minified JS)?
- How to restrict actions and filters “properly” by conditions
- Filter the query ONLY for the search results page
- opening links in new tab using – add_filter( ‘the_content’, ‘make_clickable’);
- Using add_filter() in Widgets
- Customize WordPress Media Manager – Media Window
- Apply jquery script to only woocommerce product pages and categories
- How to reduce original image quality on upload?
- Is it possible to use a forgot password url filter?
- syntax for remove_filter in parent theme with class
- Add body class of category parent
- Wrap gutenberg block ‘div’ in other elements/extra HTML
- Convert hyphen to underscore in permalinks
- Override parent theme function that is not hooked or in the functions.php file
- Remove Page Title from Static Frontpage
- Programmatically Add Font-Awesome Icons to Category Widget
- Remove bulk actions based on user role or capabilities
- Default or Preset Content for Custom Post Types
- Override a class function to include a custom template
- How to override filter in child theme?
- Removing title from page
- Hide some items from Screen options in dashboard for products
- How to change a certain text or term of WordPress into a custom into the whole site?
- Run Product Filter Javascript On Page Template
- Enqueuing External Javascript functions.php
- How to enqueue JavaScript for specific WordPress pages only?
- Adding body class when post contains a specific shortcode
- Defer all js except certain ones in functions.php file
- Enqueuing Script in functions.php vs on the page
- Replace Archive Widget Link Text
- Exclude Empty Child Categories in Menu
- Properly applying nonce to a form using AJAX
- How to make unique add_filter to the_content of specific page template files – so each template gets its own addition
- Best way to programatically add “rel” attributes to page and post images
- add_filter priority problem
- Limit filter upgrader_post_install to a single plugin
- How to update feed only 2-3 times a week (for Feedburner email)?
- Manipulate Output of wp_list_something: select menu instead of li’s
- Search user metadata with checkboxes via ajax (almost working)
- wp_enqueue JavaScript in child-theme (ReferenceError) using Search & Go
- How to use IF Statement in WordPress?
- Gravity Forms field entries into wp_query loop [closed]
- Post Pagination Showing Same Posts Every Page
- Why is my Gutenberg block returning an error after initial save?
- jquery won’t load in footer
- Show excerpt for only first post in query
- Remove function or filter
- modify a function filter
- Super simple shortcode not working
- How would go about if I just want a temporary function?
- Generating rel=prev and rel=next only on wordpress categories
- How to properly add NPM packages and integrate them in WordPress?
- How to make applyFilters function return false via functions.php
- How to filter out shortcode when displaying the_excerpt() in the loop?
- Accepted arguments value in hook functions
- Get current page_id before loop, in functions.php
- How to filter a table in post content without plugins? [closed]
- Get Current User info using wp_localize_script, in functions.php
- Which action hook to use for function?
- Adding multiple taxonomy filters to functions.php
- str_replace function in theme
- How to get the post_name when in preview?
- Replace menu links with # and add name to its li
- wp_is_mobile dequeue not working
- Can’t check if a post has thumbnail adding filter to get_post_metadata()
- Adding HTML to the end of every post with the Block Editor
- Last updated date function
- Why won’t my scripts load?
- Loading CDN that requires jQuery in WordPress
- Modify a function without editing template
- How to hide unused profile fields?
- wp_register_script(… $in_footer = true) not working
- How to set default archive image without overriding first attached image? [closed]
- How do I add Bootstrap and LESS to my migrated WordPress site?
- How to add nav menu items to a specific position within a menu
- Passing values from a widget to a function within a plugin
- Only let plugin add actions to wp_head & wp_footer on single posts
- Publish/Update post is changing image links from file url to post url
- Disable auto-resizing of uploaded images, but only for certain filename
- How to make custom column Admin>Users sortable?
- Scripts not appending to element in AJAX call – why?
- Filter out other users comments. Visualize only own comments and editor role users’ comments
- Get Current Post ID in functions php, meta query filter
- call of javascript function to external url always blocked by cors
- Output and filter data from a XML url
- Add to cart php not working [closed]
- Is possible add icon in title posts only in specific tag?
- What did I do wrong in my functions code, that will not change the “Get New Password” text to “Send It”?
- create filter in functions.php
- Including a specific Javascript Script in a template. Is my code correct?