How can I remove the WordPress-Version (?ver=5.x) from my plugin


I am working on my first plugin that adds a external script to the footer. WordPress automatically adds the version number at the end, which I’m trying to remove. What I have so far:

add_action('wp_enqueue_scripts', array($this,'print_code'));

public function print_code(){
        $location   =   get_option('location_select');
        $url="https://" . esc_html($location) . '';
        wp_enqueue_script('myID', $url, array('jquery'), false, true);


This puts out the script correctly, but I still have the version (?ver=5.8) at the end. The false should avoid that, afaik. What am I missing?

Paranoia 1 year 2021-07-21T12:04:23-05:00 0 Answers 0 views 0

Leave an answer