Plugin Directory

Test out the new Plugin Directory and let us know what you think.

Add URL Slugs as Body Classes

Add URL Slugs to `body` Class

This plug-in takes the URL, chops it into pieces, and adds each "piece" as an additional class to the body tag.

Meaning, if your page's URL is: http://www.example.com/2012/02/24/wordpress-plugin-add-url-slugs-as-body-classes/ Your page's body tag would have at least these classes:

2012 02 24 wordpress-plugin-add-url-slugs-as-body-classess

It gets much stronger when you start thinking about Categories or nested Pages:


which would add:

category wordpress



would add:

movies star-trek wrath-of-khan

This allows you to very easily add custom CSS and/or JS to these pages based on these new CSS classes.

Please let me know if you have any questions/suggestions/thoughts, Atg http://aarontgrogg.com/ aarontgrogg@gmail.com

Tags: ,

Requires: 3.1 or higher
Compatible up to: 4.2.11
Last Updated: 2 years ago
Active Installs: 1,000+


4.8 out of 5 stars


0 of 1 support threads in the last two months have been marked resolved.

Got something to say? Need help?


Not enough data

0 people say it works.
0 people say it's broken.