WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Retain Microdata Code Toggling Between Views (6 posts)

  1. nickienicole
    Member
    Posted 1 year ago #

    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!

  2. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    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.

  3. nickienicole
    Member
    Posted 1 year ago #

    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!

  4. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

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

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

  5. nickienicole
    Member
    Posted 1 year ago #

    @WPyogi: Thank you for your last suggestion; I hadn't thought of that yet :)

  6. nickienicole
    Member
    Posted 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic