Wordpress strips schema.org markup

Showing 1-9 of 9 messages
Wordpress strips schema.org markup Maya 6/3/11 9:25 PM
I'm working on a self-hosted Wordpress website. After marking up some
content with schema.org microdata and switching from HTML view to
visual view and back, all the markup was stripped away.

I tried searching for a solution and found several plugins that
promised to stop Wordpress from meddling with the markup but none of
them worked. I understand that switching off the visual editor
altogether may prevent the stripping from happening; however, this is
a client website and they definitely won't be comfortable working in
HTML view once we hand the website off to them.

Has anyone figured out a workaround for this kind of situation? I'm
stumped at this point.

Re: Wordpress strips schema.org markup Maya 6/4/11 5:46 PM
Update:

I've found a workaround for Wordpress using shortcodes. I installed
the Post Snippets plugin which allows one to store reusable snippets
of code that can then be inserted into a post or a page as shortcodes
using the post editor or by manually typing them. This prevents
Wordpress from stripping away the schema.org markup.
It takes a little while to set up if you plan to use several schemas,
but once set up, you can export your Post Snippets and import them to
other Wordpress sites.

One more thing — the Post Snippets plugin allows you to define
variables, so you could create a snippet for <div itemscope
itemtype="{schema}"> that would allow you to replace {schema} with the
appropriate itemtype (for example, http://schema.org/Person/).
Re: Wordpress strips schema.org markup Aidan Owens 6/4/11 5:53 PM

Very helpful! Thanks for sharing.

Re: Wordpress strips schema.org markup Ben Atkin 6/4/11 5:58 PM
If you'd like to find out why this is happening, rather than just how to get around it, I suggest asking on Stack Overflow. It's unexpected processing that WordPress is doing, which is not specific to schema.org markup.


If you decide to ask, please post a link to the question!

Ben
Re: Wordpress strips schema.org markup Ian 7/2/11 9:23 PM
search plugins for 'schema for wordpress'
Re: Wordpress strips schema.org markup Maya 7/4/11 12:08 AM
Thanks. I actually bookmarked your site a few days ago and am planning to try it out to see how it compares to the as hoc solution that I came up with using the Post Snippets plugin. Without having yet tried it, it appears that your solution is somewhat similar, in that it also uses shortcodes, but the schema.org vocabulary is baked in.

Also, you probably figured this out, but it appears that the issue with schema.org markup and Wordpress has to do with the TinyMCE editor. A better long term solution might be to create a custom function that adds schema.org attributes as valid elements for TinyMCE . . . but then again, using shortcodes may actually be easier than using pure schema.org markup. I don't have enough experience to say which solution is more flexible/scaleable over the long run. (One of the flaws of my own solution is that it's basically limited to <div> and <span> elements. To extend it to other elements would require defining a lot more shortcodes for other HTML elements.)
Re: Wordpress strips schema.org markup Maya 7/4/11 1:29 AM
[Correction: "ad hoc solution", not "as doc solution"]
Re: Wordpress strips schema.org markup loose...@gmail.com 7/18/11 9:07 AM
Re: Wordpress strips schema.org markup Brazen Husseys 8/3/11 10:05 PM
Google does still support Rich Snippets, though, so have you thought
of simply using that format?  BTW, great idea with the shortcodes.
Also see this from a friend:

http://www.searchenginepeople.com/blog/howto-add-schema-wordpress.html



On Jul 4, 4:29 am, Maya Blyth <mjtbl...@gmail.com> wrote:
> [Correction: "ad hoc solution", not "as doc solution"]
>
>
>
>
>
>
>
> On Mon, Jul 4, 2011 at 12:08 AM, Maya Blyth <mjtbl...@gmail.com> wrote:
> > Thanks. I actually bookmarked your site a few days ago and am planning to
> > try it out to see how it compares to the as hoc solution that I came up with
> > using the Post Snippets plugin. Without having yet tried it, it appears that
> > your solution is somewhat similar, in that it also uses shortcodes, but the
> > schema.org vocabulary is baked in.
>
> > Also, you probably figured this out, but it appears that the issue with
> > schema.org markup and Wordpress has to do with the TinyMCE editor. A
> > better long term solution might be to create a custom function that adds
> > schema.org attributes as valid elements for TinyMCE . . . but then again,
> > using shortcodes may actually be easier than using pure schema.org markup.
> > I don't have enough experience to say which solution is more
> > flexible/scaleable over the long run. (One of the flaws of my own solution
> > is that it's basically limited to <div> and <span> elements. To extend it to
> > other elements would require defining a lot more shortcodes for other HTML
> > elements.)
>