Skip to content

WP plugin that removes the ID attributes from the <link> tags for the CSS. Used mostly together with mod_pagespeed

License

Notifications You must be signed in to change notification settings

primozcigler/remove-css-ids

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

WP plugin that removes the ID attributes from the tags for the CSS files. Used mostly together with mod_pagespeed.

Description

This simple plugin hooks to the wp_enqueue_scripts and removed the id='<handle of the css file>-css' attribute. Most of the time you don't need these IDs anyway.

I am using the mod_pagespeed module on my server and the combine_css filter doesn't work if the <link> tags have ID attributes. So based on this blog post I created a very very simple (basically one-liner) plugin that removes the ID attribute using regex.

There is also a very simple unit test for it, created using wp-cli: wp scaffod plugin ....

Enjoy the speedy sites! :)

Installation

  1. Unzip remove-css-link-ids.zip and upload unzipped folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the 'Plugins' menu in WordPress

Issues / suggestions

Please fork this repository, make the changes and create a pull request.

About

WP plugin that removes the ID attributes from the <link> tags for the CSS. Used mostly together with mod_pagespeed

Resources

License

Stars

Watchers

Forks

Packages

No packages published