How to Remove Paragraph Tags Around the WordPress Category Description

Sometimes you may need to use the category_description() WordPress function to output plain text, without the included paragraph tags.

Remove the Paragraph Tags: Add this to your theme’s function.php file:

This simple filter will remove the wpautop function from running on the term description. Simply add this snippet to the bottom of your theme’s function.php file and save.

remove_filter('term_description','wpautop');

Before:

<p>My Category Description</p>

After:

My Category Description

Here’s a link to the WP forum thread revealing this simple and effective filter: WP Forum Thread

Related posts:

  1. Prevent WordPress from Inserting Paragraphs on Cat Description
  2. Removing Paragraph Tags from the_excerpt(), Properly
  3. WP No Category Base: Good for SEO and Easy to Use
  4. Find and Replace a Word in a WordPress Title
  5. JavaScript Add or Remove Field Value on Focus and Blur
TwitterDiggDeliciousStumbleuponTechnoratiFacebook