Title: !important hardcode with php
Last modified: March 7, 2023

---

# !important hardcode with php

 *  [dieppon](https://wordpress.org/support/users/dieppon/)
 * (@dieppon)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/important-hardcode-with-php/)
 * Please do not add css rules with `#ancr-... ..ancr-btn-primary { color: #000 !
   important}`
 * If you add _ids_ and _!important_ this cannot be overridden.

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

 *  Thread Starter [dieppon](https://wordpress.org/support/users/dieppon/)
 * (@dieppon)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/important-hardcode-with-php/#post-16536993)
 * I have created a gist with the patch if anyone is using composer:
 * [https://gist.github.com/dieppon/93bf355eb8ffaa675bb8280a28d8303a](https://gist.github.com/dieppon/93bf355eb8ffaa675bb8280a28d8303a)
 *  Plugin Author [vaakash](https://wordpress.org/support/users/vaakash/)
 * (@vaakash)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/important-hardcode-with-php/#post-16537109)
 * Hi [@dieppon](https://wordpress.org/support/users/dieppon/),
 * This was an intentional change. There were issues reported where some styling
   were not effected in certain themes. Adding !important fixes this and does not
   cause any issue.
 * Let me know if you have any solution or suggestion for this issue
 * Thanks,
 * Aakash
 *  Thread Starter [dieppon](https://wordpress.org/support/users/dieppon/)
 * (@dieppon)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/important-hardcode-with-php/#post-16765293)
 * really? do you need to use a ID reference + .class + !important?
 * There is no way to override this on a custom theme without patching the plugin.
 * I pretty sure you can make it work without the use of !important.
 *  Plugin Author [vaakash](https://wordpress.org/support/users/vaakash/)
 * (@vaakash)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/important-hardcode-with-php/#post-16765661)
 * Hi [@dieppon](https://wordpress.org/support/users/dieppon/),
 * Yes, I’m aware of using `!important`. But note that this is a generic plugin 
   which is supposed to work on any theme with various different styles. Often times
   I see issues reported where the color selected in the settings page is not in
   effect. The reason is, themes override it and users expect the style as they 
   have chosen.
 * If you are writing CSS when you are aware of the environment then you can adjust
   the CSS specificity as needed and not use `!important` tag. But when writing 
   CSS for diverse scenarios like a plugin, I had to force the value. Removing that
   will raise issues even though the CSS specificity is high in one website or other.
 * The idea is, anything marked `!important` is expected to be changed on the settings
   page. You can however customize other properties as needed using CSS.
 * Thanks,
 * Aakash

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

The topic ‘!important hardcode with php’ is closed to new replies.

 * ![](https://ps.w.org/announcer/assets/icon.svg?rev=2325339)
 * [Announcer - Sticky Message Banner & Notification Bar](https://wordpress.org/plugins/announcer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/announcer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/announcer/)
 * [Active Topics](https://wordpress.org/support/plugin/announcer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/announcer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/announcer/reviews/)

## Tags

 * [!important](https://wordpress.org/support/topic-tag/important/)
 * [css](https://wordpress.org/support/topic-tag/css/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 4 replies
 * 2 participants
 * Last reply from: [vaakash](https://wordpress.org/support/users/vaakash/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/important-hardcode-with-php/#post-16765661)
 * Status: not resolved