Welcome to WebmasterWorld Guest from 54.196.114.201

Forum Moderators: rogerd & travelin cat

Message Too Old, No Replies

Using Microdata in a Wordpress Site

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 12, 2001
posts:1150
votes: 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 June 8, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 16, 2004
posts:1341
votes: 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 June 8, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 12, 2001
posts:1150
votes: 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 June 9, 2011 (gmt 0)

Administrator

WebmasterWorld Administrator rogerd is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Aug 2, 2000
posts: 9686
votes: 0


I wonder when we'll see more plugins. I think there's already one for RDFA markup.
7:04 pm on June 9, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 16, 2004
posts:1341
votes: 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 June 9, 2011 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lorax is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Mar 31, 2002
posts:7575
votes: 0


Maybe you could set these pages to use custom templates and/or use the shortcode approach?
10:19 pm on June 9, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 12, 2001
posts:1150
votes: 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 June 10, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 12, 2001
posts:1150
votes: 0


Actually, I mis-spoke. It's the properties and schema links that get wiped out.

This...
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<span itemprop="streetAddress">1901 Lemur Ave</span>


...becomes...

<span>1901 Lemur Ave</span>