Rich Text Tag, Category, and Taxonomy Descriptions for WordPress

August 19, 2009

in Plugins,WordPress

Rich Text Tags Plugin on WordPress.org

Taxonomies, baby!The Rich Text Tags plugin allows you to use the WYSIWYG TinyMCE text editor (the WordPress default editor) while editing Categories, Tags, and taxonomies (custom categorization created by the Yoast Simple Taxonomies plugin).

Adding Category & Tag descriptions

There’s plenty of information online on how to add category descriptions and tag descriptions to your theme. WordPress has built-in functionality for those:

How to add the taxonomy title & descriptions to your theme

Once you have the cool new rich text editor, you’ll feel pretty silly if you don’t put that great content in your theme.  So here’s what to do:  add the following snippet of code into your archive.php file.

<?php
if(isset($wp_taxonomies)) {
	// This is getting the friendly version of a taxonomy
	// - not the hyphenated get_yoast_term_title()
	$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
	if($term) {
		echo '<h2 class="pagetitle">'.$term->name.'</h2>';
	}
	// If you have a taxonomy description, let'er rip!
	if(function_exists('get_yoast_term_description') && get_yoast_term_description()) {
		echo wptexturize(get_yoast_term_description());
	}
}
?>

Using this code, you can now have custom content on your taxonomy pages, like this one for Andersen Windows.

SEO Benefits of this plugin

Besides the obvious benefits of giving users more information on your archive pages, there are intrinsic SEO benefits to having tag, category, and taxonomy descriptions.

When you have tags and categories where posts overlap, it’s a good idea to try to create as much unique content on each page as possible, so that each page gets indexed by Google. Having custom content for each page will do that.

Help me help you!

Please leave any issues you have with the plugin in the comments below. I like to squash code bugs!

Known Plugin Incompatibilities

This plugin does not work with these plugins:

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • StumbleUpon
  • Technorati
  • Twitter

Related posts:

  1. Add Custom Taxonomy Title Tags Support to All-In-One SEO Pack
  2. Add Custom Titles for Tags and Categories in WordPress
  3. SEO WordSpinner Plugin – A Killer SEO Plugin for WordPress
  4. Simple Taxonomies Formatting — Improve the Plugin’s Code Output
  5. How to tell if your WordPress Plugin or Widget is Activated in WordPress

1 trackback

Wtyczki – Dexter | NucleON IT Business Services – Test Site
December 2, 2009 at 3:28 am

20 comments… read them below or add one

David August 24, 2009 at 10:58 pm

Zack- Very cool plugin. By chance I was searching Google for a plugin that could do this and stumbled upon yours. Nice!

Any chance you can incorporate the image uploader into the editor? If that’s possible, I’d definitely use that feature!

Dave

Reply

Zack Katz August 24, 2009 at 11:02 pm

Hi David – I wanted to do that in the first version, but I didn’t have the time. This feature will definitely be in future versions…though I can’t say when.

Reply

Zack Katz August 25, 2009 at 1:51 pm

Yeah, as suspected, it’s hard…If you can figure out how, let me know!

Reply

AU Web Designer August 26, 2009 at 10:23 am

Same as David, thanks heaps! I’ll give it a try too and might get back if I figure it out.

Reply

Zack Katz September 1, 2009 at 8:32 pm

Version 1.0.3 is completed and now includes the media uploader & media library functionality!

Reply

Karen September 6, 2009 at 8:31 am

Help! I am using Thesis with open hook and when I enter the code you give to to my archives.php page to allow my category descriptions to appear on my site like the Anderson Windows example it doesn’t work.

Any idea what I could be doing wrong?

Reply

Damiano December 30, 2009 at 4:31 pm

Hi! Great plugin, but seems that category_description() strips the html tags out from descriptions… Any hints? I’m using WordPress 2.9. Thank you however!

Reply

Zack Katz December 31, 2009 at 6:55 pm

Hi Damiano, that should have been taking care of automatically when using the plugin…but you can always try adding the same code again to your functions.php file:

remove_filter( 'pre_term_description', 'wp_filter_kses' );

Reply

Damiano January 8, 2010 at 5:37 pm

Hi,
adding that string doesn’t work, at least for <li> and <img> image… I also upgraded to WordPress 2.9.1. If I’ll find something useful, I’ll posti it here.
Bye

Reply

Richard February 24, 2010 at 8:21 pm

To allow images you need to add this to the functions file
<code>remove_filter( ‘term_description’, ‘wp_kses_data’ );
remove_filter( ‘pre_term_description’, ‘wp_filter_kses’ ); /*added to allow tag images and html*/ </code> I use it and it works on 2.9.2

Sjoerd January 29, 2010 at 8:07 pm

Hi,
Did you already find a solution for the problem with the <li> and <img> tags? I’ve used allot of lists in my tag descriptions and WP strips them all.. :S
Bye,
Sjoerd

Reply

JHouse February 5, 2010 at 4:36 am

Very cool plugin. I got it working partially, but I couldn’t separate the text into paragraphs. Well, I could in the editor, but it wouldn’t show on the main site. I added the function code you provided as well, but no dice. Also, every time I added pasted text (I was working on text in a text editor), it would oddly add it twice. Any thoughts as to what’s causing this?
Thanks.

Reply

Scot Hacker February 10, 2010 at 11:16 pm

This plugin isn’t stripping out the IMG tags – you can save and then view source to confirm that your image paths are still there. The problem is that as of WP 2.9, the WP category_description function strips out IMG and other tags.
The fix is here, and it’s simple:
http://wordpress.org/support/topic/343659?replies=7
Nutshell: Just use this in your archive.php template instead:
$category = get_the_category();
echo $category[0]->category_description;

Reply

Scot Hacker February 11, 2010 at 12:49 am

Ack – paragraph breaks are being stripped out in 2.9.1 (like JHouse says above). This is a show stopper.
The other plugin with similar functionality:
http://www.laptoptips.ca/projects/category-description-editor/
doesn’t have this problem, but it doesn’t allow direct media upload like yours does. If only the bugs in these two plugins would cancel each other out…

Reply

Michael June 10, 2010 at 7:31 pm

Good Job.
The plugin very useful.
Now I have a question:
When i use it, the <H1> does not work.
Can you check the url:http://mijiale.me/tag/google

Google
All about Google.

the website is like this.
but in the admin, it is this

Google
All about Google.

 
Thank you very much.

 

Reply

Michael June 10, 2010 at 7:33 pm

the last comment,
GoogleAll about Google.
the first Google should be in <h1>, in the comment, it doesn’t work.

Reply

Matt Halfhill July 28, 2010 at 4:16 pm

Thank you for the informative post and great plugin!

I was wondering if you know how to echo images, links, and other html with the tag_description(); ? I use the Rich Text Tag plugin so that I can easily add in images and links, but when I make the echo call, it strips these out.

I am using WP 3.0 and heard that 2.9 was a party pooper with alot of things, but is there a hack around this?

Much thanks!

Reply

Rob July 29, 2010 at 6:41 pm

Hi – The uploader is not showing above the category description. Any idea why that may happen?

Reply

Christine August 17, 2010 at 7:18 pm

I added these 2 lines to my functions, which is allowing for classes and styles and images.
remove_filter( ‘term_description’, ‘wp_kses_data’ );
remove_filter( ‘pre_term_description’, ‘wp_filter_kses’ );

However, I’m having some issues with images. When in the lightbox with images in gallery, it won’t allow me to “Insert into Post” is this simply because it’s not a post? Also, it’s not allowing for captions. It’s spitting out the tags used, but in the Visual view it shows the caption.

This is what caption copy looks like.

Do captions not work?

Thanks for your help,
Christine

Reply

Christine August 17, 2010 at 7:19 pm

My example caption copy, above, turned into a caption…haha, basically it’s not doing that in my Taxonomy Description. Did I mention this is a description for Custom Taxonomies? Maybe that’s an issue as well.

Thanks again!

Reply

Leave a Comment

Previous post:

Next post: