Title: Remove schema markup
Last modified: May 27, 2020

---

# Remove schema markup

 *  Resolved [johnbenedict](https://wordpress.org/support/users/johnbenedict/)
 * (@johnbenedict)
 * [6 years ago](https://wordpress.org/support/topic/remove-schema-markup/)
 * In your FAQs you give the following code to remove the default schema markup:
 * `remove_action( 'amp_post_template_head', amp_post_template_add_schemaorg_metadata');`
 * It does not appear to work. Here is what I am trying:
 *     ```
       add_action( 'amp_post_template_head', 'my_amp_customizations' );
       function my_amp_customizations() {
         remove_action( 'amp_post_template_head', 'amp_print_schemaorg_metadata' );
         remove_action( 'amp_post_template_head', 'amp_post_template_add_schemaorg_metadata' );
       }
       ```
   
 * Note that I am trying both:
    `amp_post_template_add_schemaorg_metadata` and `
   amp_print_schemaorg_metadata`
 * Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Weston Ruter](https://wordpress.org/support/users/westonruter/)
 * (@westonruter)
 * [6 years ago](https://wordpress.org/support/topic/remove-schema-markup/#post-12902158)
 * OK, yeah, that’s incorrect in the FAQ.
 * The right way to remove the default Schema.org should be to do this:
 * `add_filter( 'amp_schemaorg_metadata', '__return_empty_array' );`
 * But, I see this isn’t working as expected either as it results in:
 * `<script type="application/ld+json">[]</script>`
 * But that should still work for your intents and purposes. I’ll file an issue 
   to fix this, to ensure this works.
 * Alternatively, you can do this which will prevent that from happening, but it
   isn’t as ergonomic:
 *     ```
       add_filter( 'amp_optimizer_config', function( $config ) {
       	$config['transformers'] = array_diff(
       		$config['transformers'],
       		[ 'AmpProject\AmpWP\Transformer\AmpSchemaOrgMetadata' ]
       	);
       	return $config;
       } );
       ```
   
 * Nevertheless, if you add a Schema.org metadata script yourself then the AMP plugin
   should avoid adding one of its own.
 * Please subscribe to this issue for updates: [https://github.com/ampproject/amp-wp/issues/4783](https://github.com/ampproject/amp-wp/issues/4783)
 * [@jamesosborne](https://wordpress.org/support/users/jamesosborne/) Please update
   the FAQ accordingly.
 *  Thread Starter [johnbenedict](https://wordpress.org/support/users/johnbenedict/)
 * (@johnbenedict)
 * [6 years ago](https://wordpress.org/support/topic/remove-schema-markup/#post-12902854)
 * Thank you [@westonruter](https://wordpress.org/support/users/westonruter/)! I
   really appreciate the fast response.
 * I’ll take the less ergonomic solution for now. Looking forward to the update.
 *  [James Osborne](https://wordpress.org/support/users/jamesosborne/)
 * (@jamesosborne)
 * [6 years ago](https://wordpress.org/support/topic/remove-schema-markup/#post-12903772)
 * [@johnbenedict](https://wordpress.org/support/users/johnbenedict/) Thanks for
   highlighting this. Corrected now on the plugins [FAQs](https://amp-wp.org/documentation/frequently-asked-questions/)
   page.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Remove schema markup’ is closed to new replies.

 * ![](https://ps.w.org/amp/assets/icon.svg?rev=2527602)
 * [AMP](https://wordpress.org/plugins/amp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/amp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/amp/)
 * [Active Topics](https://wordpress.org/support/plugin/amp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amp/reviews/)

## Tags

 * [schema markup](https://wordpress.org/support/topic-tag/schema-markup/)

 * 3 replies
 * 3 participants
 * Last reply from: [James Osborne](https://wordpress.org/support/users/jamesosborne/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/remove-schema-markup/#post-12903772)
 * Status: resolved