Remove Class From WordPress Body & Post Classes

These code snippets enable you to remove body & post classes in WordPress.

You can use the code directly in a template file which uses the WordPress Template hierarchy or via your functions file if you add a conditional tag after the function.

This code comes in handy when you want to use a front-page.php template on archives or elsewhere in the same theme as you don’t need to remove or modify existing CSS for classes generated by the template file you want to re-use.

Here’s the code snippets for logged in members:

Was This Tutorial Helpful?

Free

$0

Access only to all free tutorials per month.



Monthly

$75

Access to 10 premium tutorials per month.


Tutorial Request


Includes code guarantee and coding support.

Yearly

$500

Access to 15 premium tutorials per month.


Monthly Tutorial Request


Includes code guarantee and priority coding support.