Home › Forums › General Issues › itemprop code being stripped
HI. I am have been using ACF for a year, but not to its FULL capabilities as it is quite complex in what it can do — you already know this, so forgive me if I am not using it correctly.
I have a wysiwyg field that I enter:
<div itemscope itemtype="http://schema.org/Review">
<meta itemprop="description" content="Skylight Alternative. Fill your home with the sun's free natural light." />
<meta itemprop="datePublished" content="2016-08-15" />
But when it renders, it just shows this:
<div>
What am I doing wrong?
Is that suppose to happen?
Not sure where to put this question so it is in General Issues…
This is not an ACF issue, but a WP issue. WP does not recognize those attributes as being valis, so it strips them out. You must modify WP and TinyMCE to allow those attributes or install a plugin that does this. https://github.com/Hube2/wp-schema-org-in-editor
thank you for the reply and insight, what makes your statement confusing is that when I enter the data into the default WP editor, the code is not stripped.
When i enter it into the advanced custom field does it remove it.
You may have something installed that works in the normal content editor but it not effecting the ACF editor?
What version of ACF are you using?
I just tested this on a basic WP site with nothing else installed. If I add this to the main editor in code view.
<div itemscope itemtype="http://schema.org/Review">
<meta itemprop="description" content="Skylight Alternative. Fill your home with the sun's free natural light." />
<meta itemprop="datePublished" content="2016-08-15" />
</div>
the switch to visual and then back to code view, the only thing that’s still there is
<div></div>
So I have to assume that you have something already installed that is modifying the main WP editor field.
interesting. thanks for the help. I do not know what I would have to do that.
Back to the first thing you sent, how do I install the wp-schema-org-in-editor.php file onto my site? Where, what directory, and is there any other coding like in the functions file?
The reason I asked what version of ACF you’re using is that the editor in 4 is different than the editor in 5. Installing that plugin I suggested may not help you.
Sorry, sorry, long day, I read your question but blanked out.
ACF version is: 4.4.11
there is a beta version of ACF5 for free download that needs testing, but I don’t think it’s recommend to install on a live site yet.
But this is the reason that it’s working for you in the normal wp editor but not in ACF. The editor in ACF4 is a different editor and you need to configure it to allow what you want separately, and to be honest, I don’t know how you’d go about doing that or even the first place to start. You must have a plugin already installed that’s allowing the schema markup, though I wouldn’t know what it is. Either that or someone has added some custom filters to your site that allowing it.
I believe that the editor works in a similar way, what you would need to do is start digging through the ACF 4 field code and create something. There may be something out there already, but again, I can’t say. I don’t recall seeing anything on this subject here on this forum.
here is the funny part. i entered that code in text view and previewed it, it looked good, I added more, saved as draft, it looked good. the moment I switched to visual view and went back, the code was stripped.
I now see what you mean, so no, I do not have anything that made it stay.
so it does not work either way, I guess it will be a hard coded templated for this.
AHHH. I see, I can create a field with that data and then it should work… OOOH, I like it,
The topic ‘itemprop code being stripped’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.