PluginSift
PluginsThemesCompare
Directory
  • Plugins
  • Themes
  • Compare Plugins
Plugin Comparisons
  • SEO
  • Security
  • Ecommerce
  • Page Builders
  • Caching
  • Backup
  • Forms
  • Analytics
Resources
  • About
  • Contact
  • llms.txt

© 2026 PluginSift. Data sourced from WordPress.org. · [email protected]

  1. Home
  2. Plugins
  3. URL
  4. Slug as body class
Slug as body class icon

Slug as body class

Add a unique class to the body tag for easy styling of individual pages

By Carlo Roosen·URL·Free
5(6 reviews)
·100 active installs·Updated 11 years ago
DownloadCompare

As of April 2026, Slug as body class is a WordPress url plugin with 100 active installations and a 5/5 rating from 6 reviews. It has been downloaded 3.4K+ times in total. Requires WordPress 3.7+ and PHP false+. Available on WordPress.org since 2014. Last updated 11 years ago — may have compatibility concerns. Top alternative: Custom Post Type Permalinks.

5/56 reviews
100active installs
3.4K+total downloads
12 yearssince 2014

Overview

Want to have css styling rules for individual pages or posts?

This plugin adds a unique class to the body tag of the html. The added class is formatted as “[post_type]-[post_name]”. For a page with slug (= post_name) “about” it will be “page-about”, and for a post named “today” it will be “post-today”. Currently no slug will be added for archive and category pages. Please let us know if you need this and we will add it.

example

Say you want to have a red title on your contact page. With this plugin all you need to do is add this line to your css:

body.page-contact h1 {
color : red;
}

Acknowledgements

Thanks to Damiaan van Vliet for this plugin idea http://www.albuswebdesign.nl/.

Read full description on WordPress.org

Ratings & Reviews

56 reviews
5 ★
6
4 ★
0
3 ★
0
2 ★
0
1 ★
0

Compatibility

WordPress3.7+ requiredTested up to 3.9.40
PHPfalse+ required

Top Alternatives to Slug as body class

Custom Post Type Permalinks icon
Custom Post Type Permalinks
4.8200K+ installsUpdated 4 days ago
ViewCompare
Custom Permalinks icon
Custom Permalinks
4.1100K+ installsUpdated 5 months ago
ViewCompare
Featured Image from URL (FIFU) icon
Featured Image from URL (FIFU)
4.670K+ installsUpdated 2 months ago
ViewCompare
Shortcode Redirect icon
Shortcode Redirect
4.310K+ installsUpdated 7 months ago
ViewCompare
Simple Page Redirect icon
Simple Page Redirect
510K+ installsUpdated 2 months ago
ViewCompare
View all url plugins →

Frequently Asked Questions

Changelog

1.0

First publication on 2014 August 4

View full changelog on WordPress.org

Contributors

Elena MukhinaElena MukhinaCarlo RoosenCarlo Roosen
Plugin Info
Version
1.0
Last Updated
Aug 11, 2014
WP Requires
3.7+
Tested Up To
3.9.40
PHP Requires
false+
Active Installs
100
Downloads
3.4K+
Added
Aug 9, 2014
Business
Free

Tags

urlbodyslugclass

Developer

C
Carlo Roosen
5 plugins0.0M+ total installs
View all plugins →

Quick Compare

Slug as body class vs Custom Post Type Permalinks→Slug as body class vs Custom Permalinks→Slug as body class vs Featured Image from URL (FIFU)→

Plugin data sourced from WordPress.org. Analysis and metrics by PluginSift.