I am a complete novice when it comes to code; but I am trying to get my head around building a website for the purpose of promoting my own business. So please be kind in your responses. 🙂
I am trying to add schema.org
microdata to my 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 & text editor, the schema info is removed!
I found the following code online that suggests a work around. It has to be entered into the functions.php
file.
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, is that all I have to do, or should I specify certain tags to allow? I really don’t understand all this code stuff; I can work it out when clear instructions are given. 🙂
Mostly I just want to make sure that I am not leaving myself open to any security vulnerabilities and such.