How to Remove Genesis Schema

Coding Puppies Wrestling with PHP Code

So I have been asked on several websites how I removed the schema that is built in to Genesis. While the Genesis default schema is probable great for most sites. It has been blamed as the probable cause of recipe pictures not appearing on Google organic search.

The theory from several experts on Google Webmaster Tools is that there is just too much schema ahead of the recipe schema so that they were not being recognized as recipes as the primary content of the page. Especially after you told Google you are a webpage, a blog and a blogposting ahead of mentioning recipe. Before Panda 4.0 this didn’t seem to matter. Now it appears to. So if you are Google, no recipe picture for you since your are not mainly a recipe. True??? I don’t know but it may be causing a 30% plus decrease in traffic to my site.

Has it worked???? Nope not yet but only 5 days since the change which isn’t much in Google Time.

WARNING – WARNING – WILL ROBINSON.

I’m not a programmer… at least not now. 40 years ago yes. Now NO. I’m a pediatrician with a hobby of food blogging, photography and dabbling in some programing. If you can not do the following. DO NOT DO THIS.

  1. You have a complete current backup of you blog. Mine backs up automatic daily and restores with a couple of clicks. You need a back up system anyways. You are playing with PHP not CSS here. Programming not wallpaper. You can destroy things.
  2. You must be able to FTP files to your site. If you don’t know what this is or can’t handle it, stop reading  and give up now before you hurt yourself or your blog.
  3. You are responsible for any damage you do, not me. This is what appears to be working for me. It is at the limit of my knowledge at this time.

I will not be able to help you with modifications or issues. Not my job. It may not be the correct or best method.  Sorry you get what you paid for… Having said that, with a few modifications you can put any schema you want on any post, page or group of posts or pages.

So my current setup that this is working on WordPress 3.9.1 Genesis 2.1.2 Foodie 2.0 v1.0.9

Lets get on with it. You should have or need a copy of your child theme on your computer. All modifications are to the child theme functions.php NOT the Genesis functions.php. Never modify things in the Genesis folder.

So open you functions.php  in a text editor of some type. I used Wordpad (on my PC) and I’m sure there is a similar program on a Mac. DO NOT use Word. DO NOT use the editor in WordPress.

Near at the top of the child functions.php enter the following:

//* creates an empty array
function custom_schema_empty( $attributes ){
$attributes[‘itemtype’] = ”;
$attributes[‘itemprop’] = ”;
$attributes[‘itemscope’] = ”;
return $attributes;
}

Now before genesis() add the following. In Foodie it is slightly different but clearly labeled as loading genesis.

//* wipes out the data in these areas
add_filter( ‘genesis_attr_body’, ‘custom_schema_empty’, 20 );
add_filter( ‘genesis_attr_site-header’, ‘custom_schema_empty’, 20 );
add_filter( ‘genesis_attr_nav-primary’, ‘custom_schema_empty’, 20 );
add_filter( ‘genesis_attr_content’, ‘custom_schema_empty’, 20 );
add_filter( ‘genesis_attr_entry’, ‘custom_schema_empty’, 20 );
add_filter( ‘genesis_attr_sidebar-primary’, ‘custom_schema_empty’, 20 );
add_filter( ‘genesis_attr_site-footer’, ‘custom_schema_empty’, 20 );
add_filter( ‘genesis_attr_comment’, ‘custom_schema_empty’, 20 );
add_filter( ‘genesis_attr_comment-author’, ‘custom_schema_empty’, 20 );

I want a bit overboard wiping out everything and may back off some later.

Now time to save your file locally. Do not wipe out your original file so do not use “save” but use “save as”. Save this as functionsA.php

Sign on via ftp and go to the foodie or your child theme folder. Upload functionsA.php in the same spot as you find the functions.php file. Now working quickly change the name of your functions.php to functionsB.php. Rename functionsA.php to functions.php. Close connection.

If the gods are with you, your site is still alive. Flush any cashe you have engaged. Load a random post and check the page source code. How to do this will vary by OS and browser. Search for schema and all should be gone (except for recipe for me from the recipe plugin)

Dead site… sign back on by FTP. Rename that file you changed to functionsB.php to functions.php and you should be good.

Good luck to all. I think this will work for most genesis sites but only tested on mine.

Now if you know what you’re doing, please let me know.

Please post your results

References:
Designs By Nick the Geek:Genesis Explained: The Genesis Theme Framework  This is a great series of tutorials that is a “deep dive” into what Genesis really is. Just at the edge of my understanding if I read slow. This is on my “bucket list”.

rtmeier.net : Using genesis_markup() with html5 in Genesis 2.0  What you really need to know if your going to do this yourself. Has a list of “Default context filters in Genesis” that will be your guide about what filter is placing what Schema on your blog.

Youst : Schema.org & Genesis 2.0 Yes that Youst… the first article I read on this and I used the empty array idea from him. His instructions didn’t work for me but really a must read to help understand this.

Updated

August 1 2014

Note: This has not gotten my recipe

Proudly powered by WordPress

By continuing to use the site, you agree to the use of cookies. Click here to read more information about data collection for ads personalisation

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Read more about data collection for ads personalisation our in our Cookies Policy page

Close