Welcome to WebmasterWorld Guest from 54.166.191.159

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)

WebmasterWorld Senior Member 10+ Year Member



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)

WebmasterWorld Senior Member 10+ Year Member



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)

WebmasterWorld Senior Member 10+ Year Member



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)

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



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)

WebmasterWorld Senior Member 10+ Year Member



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)

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



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)

WebmasterWorld Senior Member 10+ Year Member



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)

WebmasterWorld Senior Member 10+ Year Member



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>
 

Featured Threads

Hot Threads This Week

Hot Threads This Month