Title: AMP Validation Error for CSS: !important
Last modified: July 2, 2018

---

# AMP Validation Error for CSS: !important

 *  Resolved [michael.aulia](https://wordpress.org/support/users/michaelaulia/)
 * (@michaelaulia)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/amp-validation-error-for-css-important/)
 * Hi,
    I got lots of validation errors from Google on my AMP pages with error of“
   The text inside tag ‘style amp-custom’ contains ‘CSS !important’, which is disallowed.”.
 * I notice the plugin outputs many of these lines, for example: .amp-wp-content.
   amazon-image-wrapper a amp-img img{height:auto;position:relative!important}
 * If I deactive the plugin, these CSS types that Google AMP validator does not 
   like go away. Wondering if you can provide an update to work around these issues(
   or if something we can do to remove these generations in the mean time), and 
   if it’s going to have any effect without the “important” bit?
 * Thanks,
    Mike
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Famp-validation-error-for-css-important%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [Don Fischer](https://wordpress.org/support/users/prophecy2040/)
 * (@prophecy2040)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/amp-validation-error-for-css-important/#post-10453321)
 * Hi Mike,
    You can remove the styles using this WordPress hook: `remove_action('
   amp_post_template_css', 'amp_appip_ampstyles' , 1000);`
 * You can add that to your `functions.php` file (preferably the child theme `functions.
   php` file if using a child theme) after the opening `<?php` tag (and after any
   comments). That will remove the offending styles you are mentioning.
 * Sorry, I was not aware that the AMP CSS did not allow !important – I guess I 
   need to brush up on AMP specifications some more in the very near future!
 * Thanks for bringing this to my attention. If you have an issue adding it, let
   me know – I can throw it in a quick temporary plugin for you until the issue 
   is resolved in the main plugin.
 * Warm regards,
    Don
 *  Thread Starter [michael.aulia](https://wordpress.org/support/users/michaelaulia/)
 * (@michaelaulia)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/amp-validation-error-for-css-important/#post-10453375)
 * Hi Don,
    That works like a treat, thanks for the quick and easy solution!
 * It’s cool, we all learn new things each day and you can’t possibly know and cover
   everything out there 🙂 Cheers
 *  [Don Fischer](https://wordpress.org/support/users/prophecy2040/)
 * (@prophecy2040)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/amp-validation-error-for-css-important/#post-10455115)
 * Thanks for the update Mike!
    I’ll also add a setting to turn this on/off for 
   future as well.
 * Warm regards,
    Don

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

The topic ‘AMP Validation Error for CSS: !important’ is closed to new replies.

 * ![](https://ps.w.org/amazon-product-in-a-post-plugin/assets/icon.svg?rev=1565235)
 * [Amazon Product in a Post Plugin](https://wordpress.org/plugins/amazon-product-in-a-post-plugin/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/amazon-product-in-a-post-plugin/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/amazon-product-in-a-post-plugin/)
 * [Active Topics](https://wordpress.org/support/plugin/amazon-product-in-a-post-plugin/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amazon-product-in-a-post-plugin/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amazon-product-in-a-post-plugin/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Don Fischer](https://wordpress.org/support/users/prophecy2040/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/amp-validation-error-for-css-important/#post-10455115)
 * Status: resolved