Support » Plugin: TinyMCE Advanced » Retain Microdata Code Toggling Between Views

  • Resolved nickienicole


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

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

    However, when I update, then toggle to Visual view, and update again, 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, so those are not solutions for me.

    I saw this post here, that would probably do the trick to add “extended_valid_elements”; however, I do not know where to place that code, since I do not have backend access to those files. Also, I’m pretty sure any changes to the code would get overwritten if the client ran an update anyway.

    We do have TinyMCE Advanced plugin installed, but I’m not sure if I can implement a solution using it. Does anyone have any ideas? I’ve spent hours searching on the web to try to fix this, including extensive research on WordPress forums, and I’ve come up with nothing.

    Any help is much appreciated!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Andrew Ozz


    WordPress Dev

    Yes, you will need to “tell” TinyMCE about all new tag attributes. Extended_valid_elements is a good way to do that: Alternatively, if you’re only using DIVs, can add div[*] to allow any attr on this tag, but do read through TinyMCE’s documentation to understand how that will affect the editor.

    To add custom settings to the TinyMCE init you would need something like, or you can hard-code them in a small WordPress plugin.

    Thank you, Andrew! I can’t view the first link about configuration without signing up I guess. A couple questions, though, since I’m not too experienced with editing plugins. First: where to I place the extended_valid_elements code? And second: If I edit the plugin code, won’t it overwrite my changes, if the client makes an update to that plugin?

    Plugin Author Andrew Ozz


    WordPress Dev

    Hmm, think the link has changed. Try through this page:

    To do this “manually” you’ll need to make a custom WP plugin. It’s not hard but you’ll need to know some PHP and read through the codex on how plugins work. If you’re not into this kind of things, use the plugin from the second link above 🙂

    I finally solved this issue by creating a Custom Field and pasting the code exactly the way I wanted.

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