Getting started with WordPressget_bloginfo()Enqueuing scriptsMaking network requests with HTTP APIEnqueuing Styleshome_url()Custom Post Typestemplate_includeThe Loop (main WordPress loop)AJAXThe $wpdb ObjectActions and Filterswp_get_current_user()Add/remove contact info for users with user_contactmethods filter hookCreating a custom templateCustomizer Hello WorldCustomizer Basics (Add Panel, Section, Setting, Control)The Admin Bar (aka "The Toolbar")Querying postsAlternating main loop (pre_get_posts filter)ShortcodeCreate a Post Programmaticallyget_template_part()Taxonomiesget_template_part()ShortcodesPost FormatsCustom exerpts with excerpt_length and excerpt_morePlugin developmentSecurity in WordPress - EscapingTemplate hierarchyRemove Version from Wordpress and StylesheetsChild Theme Basicsadd_action()get_template_part()Shortcode with attributeSidebarsSecurity in WordPress - SanitizationinitCreate Template for Custom Post TypeFunction: add_action()Add ShortcodeHow Can I integrate Markdown editor with Advance Custom Field's repeater Add-on.Installation and Configurationwp_get_current_user()WP-CronSecure your installationOptions APIFunction : wp_trim_words()WP_Query() LoopUpdate WordPress ManuallyThemesWP-CLIDebuggingadd_menu_page()add_submenu_page()get_option()get_permalink()get_the_category()the_title()get_the_title()add_editor_style()add_theme_support()WordPress Plugin creationRun WordPress local with XAMPPAdmin Dashboard WidgetsSite MigrationMeta BoxRemove Auto Line Breaks From Content and Excerptget_home_path()Wordpress theme and child-theme developmentREST API

Remove Version from Wordpress and Stylesheets

Other topics

Remarks:

Intended to improve site speed and safety.

Remove version numbers from css/js

Just add this function to your functions.php. It will remove the version from all enqueued js and css files.

function remove_cssjs_ver( $src ) {
   if( strpos( $src, '?ver=' ) )
   $src = remove_query_arg( 'ver', $src );
   return $src;
}

add_filter( 'style_loader_src', 'remove_cssjs_ver', 999 );
add_filter( 'script_loader_src', 'remove_cssjs_ver', 999 );

Remove version numbers from WordPress

If you add this to your functions.php it removes the WordPress version number from the RSS feed and the header.

function remove_wordpress_ver() {
     return '';
}
add_filter('the_generator', 'remove_wordpress_ver', 999);

Syntax:

  • add_filter( $tag, $function_to_add, $priority, $accepted_args)

Parameters:

ParameterDetails
$tag(string required) Name of the filter where $function_to_add is hooked to
$function_to_add(callable required) Name of the function which runs when the filter is applied
$priority(int optional) place of $function_to_add between other functions in one action (default = 10)
$accepted_args(int optional) Number of parameters which $function_to_add accepts (default = 1)

Contributors

Topic Id: 6218

Example Ids: 21522,29605

This site is not affiliated with any of the contributors.