|Using Microdata in a Wordpress Site|
I've been testing Schema microdata mark-up in a WP site, and there are some very bad problems --not the least of which is: it won't work.
As far as I can see, you can use the HTML Editor to insert the correct mark-up and Google's Rich Snippets Test Tool will read it. But, as soon as you come out of the HTML Editor to the Visual Editor, the next "Save" or WP "Autosave" wipes out all the mark-up.
I've tried wraping the mark-up in "<code>," "<pre>," and "<![CDATA[" tags, but none will work correctly.
I also tried all the plugins that disable WP Auto Formatting, still no help.
Turning off the visual editor on your user profile is about as close as you'll come.
After that you may be able to add some remove_filter() functions to get rid of the <p> tags it wraps everything in.
This is a MAJOR PITA with WordPress.
Thanks. I tried disabling the visual editor with no luck, and I'll look into the remove_filter() functions next.
<This is a MAJOR PITA with WordPress.>
WP is an amazing piece of software and it has allowed a tremendous number of people to accomplish a lot, but man, that text editor is beyond clunky.
I wonder when we'll see more plugins. I think there's already one for RDFA markup.
In addition to the default TinyMCE editor shipped with WP, you can upgrade it (with the TinyMCE Advanced plugin or manually if you got skills).
BUT ...regardless of which editor you use with WordPress, the output is still filtered and reformatted
The majority of the reformatting is done by the wp-includes/formatting.php file.
How WordPress processes post content is explained here: [codex.wordpress.org...]
Maybe you could set these pages to use custom templates and/or use the shortcode approach?
I tried shortcodes and even tables, but the problem remains that all the microdata classes, etc. gets wiped out by WP.
I have several sites on the same topic and for now I'm writing the microdata into a (gasp!) FrontPage site that's taking it perfectly. Whatever markup I put in place, stays in place. I really wanted to use microdata markup in the other WP sites, but it's just not working.
I've been keeping up with the progress of a few plugins (Recipes only for now) and that author had the same problem with the initial version of her plugin --she could get the data set-up fine, but she couldn't go back and edit it without re-doing the whole thing.
There are a few other plugins that are supposedly being written for what I'm looking to do, but to be honest, I really don't want to build a significant body of markup based on a plugin whose author may or may not keep their plugin compatible with future versions of WP.
Actually, I mis-spoke. It's the properties and schema links that get wiped out.
|<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"> |
<span itemprop="streetAddress">1901 Lemur Ave</span>
|<span>1901 Lemur Ave</span> |