WordPress TinyMCE HTML Removal
I am a complete newbie when it comes to code; but i'm trying to draw attention to building a website to promote my own business. So please be kind in your answers. :)
I am trying to add schema.org
microdata to a WordPress website in the following format:
<div itemscope itemtype="http://schema.org/LocalBusiness">
<span itemprop="name">Business name</span>
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<span itemprop="streetAddress">business address</span>
<span itemprop="addressLocality">city</span>
<span itemprop="addressRegion">state</span>
<span itemprop="postalCode">bb1 bb2</span>
</div>
Phone: <span itemprop="telephone">0909090909</span>
</div>
The problem is that every time I switch between visual and text editor the schematic information gets deleted!
I found the following code on the internet that suggests a job. It must be entered into the file functions.php
.
function override_mce_options($initArray) {
$opts = '*[*]';
$initArray['valid_elements'] = $opts;
$initArray['extended_valid_elements'] = $opts;
return $initArray;
}
add_filter('tiny_mce_before_init', 'override_mce_options');
My question is, what do I need to do, or do I have to specify certain tags to allow? I don't really understand all this code stuff; I can figure it out when clear instructions are given. :)
Basically I just want to make sure that I don't leave myself open to any security vulnerabilities etc.
source to share
No one has answered this question yet
Check out similar questions: