[ WordPress.org  ](https://wordpress.org/)

  * [ News  ](https://wordpress.org/news/)
  * [ Showcase  ](https://wordpress.org/showcase/)
  * [ Hosting  ](https://wordpress.org/hosting/)
  * Extend 
    * [ Themes  ](https://wordpress.org/themes/)
    * [ Plugins  ](https://wordpress.org/plugins/)
    * [ Patterns  ](https://wordpress.org/patterns/)
    * [ Blocks  ](https://wordpress.org/blocks/)
    * [ Openverse  ↗  ︎  ](https://openverse.org/)
  * Learn 
    * [ Learn WordPress  ](https://learn.wordpress.org/)
    * [ Documentation  ](https://wordpress.org/documentation/)
    * [ Forums  ](https://wordpress.org/support/forums/)
    * [ Developers  ](https://developer.wordpress.org/)
    * [ WordPress.tv  ↗  ︎  ](https://wordpress.tv/)
  * Community 
    * [ Make WordPress  ](https://make.wordpress.org/)
    * [ Photo Directory  ](https://wordpress.org/photos/)
    * [ Five for the Future  ](https://wordpress.org/five-for-the-future/)
    * [ Events  ](https://events.wordpress.org/)
    * [ Job Board  ↗  ︎  ](https://jobs.wordpress.net/)
  * About 
    * [ About WordPress  ](https://wordpress.org/about/)
    * [ Enterprise  ](https://wordpress.org/enterprise/)
    * [ Gutenberg  ↗  ︎  ](https://wordpress.org/gutenberg/)
    * [ Swag Store  ↗  ︎  ](https://mercantile.wordpress.org/)
  * [ Get WordPress  ](https://wordpress.org/download/)

Search in WordPress.org

[ Get WordPress ](https://wordpress.org/download/)

[ WordPress.org  ](https://wordpress.org/)

[ WordPress Developer Resources ](https://developer.wordpress.org)

script_loader_tag

  * [ Developer Blog  ](https://developer.wordpress.org/news/)
  * [ Code Reference  ](https://developer.wordpress.org/reference/)
  * [ WP-CLI Commands  ](https://developer.wordpress.org/cli/commands/)

  * [ Developer Blog  ](https://developer.wordpress.org/news/)
  * [ Code Reference  ](https://developer.wordpress.org/reference/)
  * [ WP-CLI Commands  ](https://developer.wordpress.org/cli/commands/)

[ Home ](https://developer.wordpress.org) [ Reference
](https://developer.wordpress.org/reference/) [ Hooks
](https://developer.wordpress.org/reference/hooks/) [ WP_Scripts::do_item
](https://developer.wordpress.org/reference/classes/wp_scripts/do_item/)
script_loader_tag

Search

#  apply_filters  ( ‘script_loader_tag’,  string  $tag  ,  string  $handle  ,
string  $src  )

##  In this article

Table of Contents

  * Parameters 
  * Source 
  * Related 
  * Changelog 
  * User Contributed Notes 

↑  Back to top

Filters the HTML script tag of an enqueued script.

##  Parameters

` $tag ` string

    

The ` <script> ` tag for the enqueued script.

` $handle ` string

    

The script’s registered handle.

` $src ` string

    

The script’s source URL.

##  Source

    
    
    $tag = apply_filters( 'script_loader_tag', $tag, $handle, $src );
    

[ View all references ](https://developer.wordpress.org/reference/files/wp-
includes_class-wp-scripts-php-2/) [ View on Trac
](https://core.trac.wordpress.org/browser/tags/6.5/src/wp-includes/class-wp-
scripts.php#L441) [ View on GitHub ](https://github.com/WordPress/wordpress-
develop/blob/6.5/src/wp-includes/class-wp-scripts.php#L441-L441)

##  Related

Used by  |  Description   
---|---  
[ WP_Scripts::do_item() ](https://developer.wordpress.org/reference/classes/wp_scripts/do_item/) ` wp-includes/class-wp-scripts.php ` |  Processes a script dependency.   
  
##  Changelog

Version  |  Description   
---|---  
[ 4.1.0 ](https://developer.wordpress.org/reference/since/4.1.0/) |  Introduced.   
  
##  User Contributed Notes

  1. Skip to note 3 content 

[ opportus ](https://profiles.wordpress.org/opportus/) [ 7 years ago
](https://developer.wordpress.org/reference/hooks/script_loader_tag/#comment-1902)

[ You must log in to vote on the helpfulness of this note
](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fscript_loader_tag%2F%23comment-1902
"You must log in to vote on the helpfulness