homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / WordPress
Forum Library, Charter, Moderators: lorax & rogerd

WordPress Forum

Using Microdata in a Wordpress Site

 7:26 pm on Jun 7, 2011 (gmt 0)

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.

Any ideas?



 3:34 am on Jun 8, 2011 (gmt 0)

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.


 4:18 am on Jun 8, 2011 (gmt 0)

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.


 3:31 pm on Jun 9, 2011 (gmt 0)

I wonder when we'll see more plugins. I think there's already one for RDFA markup.


 7:04 pm on Jun 9, 2011 (gmt 0)

The WordPress 'Rich Text' editor is a 3rd party Javascript editor called TinyMCE -- see: [tinymce.moxiecode.com...]

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...]


 9:35 pm on Jun 9, 2011 (gmt 0)

Maybe you could set these pages to use custom templates and/or use the shortcode approach?


 10:19 pm on Jun 9, 2011 (gmt 0)

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.


 12:48 am on Jun 10, 2011 (gmt 0)

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>

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / WordPress
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved