Support » Fixing WordPress » Retain Microdata Code Toggling Between Views

  • Resolved nickienicole

    (@nickienicole)


    I need to add Schema.org microdata to multiple locations pages for a client’s site.

    In HTML view I can enter:
    <div itemprop=”name”>Name</div>

    However, when I toggle to Visual view, and update, it strips out all microdata code to just <div> or <span>.

    I know there are multiple plugins available for adding microdata, but none of them do exactly what I want, plus it’s a lot more time-efficient if I just do it myself. So those are not solutions for me.

    Also, manually editing the TinyMCE files won’t work, because I do not have access to them, and I believe they will get overwritten when there’s an update anyway. I saw this post here, that would probably do the trick: https://snipt.net/jamesw/prevent-tinymce-from-stripping-schemaorg-attributes-in-wordpress/
    However, I do not know where to place that code, if I can, since I do not have backend access to those files.

    We do have TinyMCE Advanced plugin installed, but I’m not sure if this is a solution. I’ve spent hours searching on the web to try to fix this, including extensive research on this forum, and I’ve come up with nothing.

    Please help!

Viewing 5 replies - 1 through 5 (of 5 total)
  • WPyogi

    (@wpyogi)


    Forum Moderator


    Switching between Visual and Text editors is best avoided – it WILL strip out code. It’s a known issue. Try just using TEXT and updating before switching to the other.

    Thank you, WPyogi, but I’ve actually tried that, too. I did “update” while in TEXT, but when I switched over (and updated), it stripped it all out. If it was just me working on the site, it would be no big deal; I could just leave it all in text, but the client will be making changes, and once they do, all the work will disappear!

    WPyogi

    (@wpyogi)


    Forum Moderator


    I really don’t know but you might ask on the Advanced TinyMCE plugin forum here:

    http://wordpress.org/support/plugin/tinymce-advanced

    @wpyogi: Thank you for your last suggestion; I hadn’t thought of that yet 🙂

    I solved this by creating a Custom Field where I could paste the code exactly as I wanted.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Retain Microdata Code Toggling Between Views’ is closed to new replies.