A plain simple plugin which allows you to add a custom CSS class the HTML body tag.
As of April 2026, Custom Body Class is a WordPress css plugin with 10K+ active installations and a 5/5 rating from 21 reviews. It has been downloaded 117K+ times in total. Requires WordPress 5.2.0+ and PHP false+. Available on WordPress.org since 2015. Downloads are up 18% this week. Top alternative: WPCode – Insert Headers and Footers +….
You can use this plugin to add a unique CSS class to your pages or posts.
TasteWP has prepared a quick WordPress instance with this plugin, so you can give it a try in this demo
There’s a way to add a class to appear only on mobile devices. You can do that by simply adding mobile- on the front of
the class. For example, if you want to have the class “car” for mobile side, you need to use “mobile-car”.
If you find this plugin helpful, or you just want to send me a coffee here are the ways:
Very handy to have a field for adding classes to a page
Exactly what I needed. Work perfectly. Thanks for making this.
Tested successfully on WordPress 5.6. Made it a lot easier to manage css for similar pages.
Just what I needed
You should be able to enter any valid class-name, including characters like % (percentage) etc. They are useful for some purposes.
| WordPress | 5.2.0+ requiredTested up to 6.8.5 |
| PHP | false+ required |
Plugin data sourced from WordPress.org. Analysis and metrics by PluginSift.