Title: Preference button not working
Last modified: August 2, 2022

---

# Preference button not working

 *  Resolved [Krissieg](https://wordpress.org/support/users/krissieg/)
 * (@krissieg)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/preference-button-not-working/)
 * Hi there,
    I’ve tried to get the ‘Manage Cookies Preference’ button to work on
   this website, but it’s just not opening the cookie preferences popup. I have 
   verified the cookie banner code is working. It seems as though there is some 
   code missing in the preference centre section? Please advise? Thanks
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fpreference-button-not-working%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Contributor [GDPR/CCPA Cookie Consent Banner Admin](https://wordpress.org/support/users/termly/)
 * (@termly)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/preference-button-not-working/#post-15882929)
 * Hi Krissieg,
 * Thank you for reaching out, after taking a look at your site along with the button
   code, we’ve identified the issue.
 * When modifying the preference center button UI, make sure to retain all of the
   class information. In this case, onclick=”displayPreferenceModal()” was deleted
   from your preference center button.
 * You can either regrab the code from the Embed preference center page or copy 
   the default code below.
 *     ```
       <button
         class="termly-cookie-preference-button"
         type="button"
         style="background: white; width: 165px; height: 30px; border-radius: 3px; border: 1px solid #5f7d9c; font-family: Roboto, Arial; font-size: 10px; color: #5f7d9c; font-weight: 600; box-sizing: border-box; cursor: pointer; padding: 0; outline: none;"
         onclick="displayPreferenceModal()"
       >
           Manage Cookie Preferences
       </button>
       ```
   
 * Thank you,
    The Termly Team
 *  Thread Starter [Krissieg](https://wordpress.org/support/users/krissieg/)
 * (@krissieg)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/preference-button-not-working/#post-15883442)
 * Thanks, I copied your code exactly and it still doesn’t work?
 *  Plugin Contributor [GDPR/CCPA Cookie Consent Banner Admin](https://wordpress.org/support/users/termly/)
 * (@termly)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/preference-button-not-working/#post-15885770)
 * Hi Krissieg,
 * I just took another look at the new button implemented, it looks like you’re 
   still missing the onclick portion.
 * Here is a screenshot of the live code on your site.
    [Preference center code](https://imgur.com/a/HJCSAjl)
 * I would suggest moving the button out of the paragraph tags <p> or other divs.
   Inserting it into the footer is the most common placement for this feature.
 *  Thread Starter [Krissieg](https://wordpress.org/support/users/krissieg/)
 * (@krissieg)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/preference-button-not-working/#post-15887714)
 * Yes, me adding the code in its own section has worked. Thank you for your help!
   🙂

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

The topic ‘Preference button not working’ is closed to new replies.

 * ![](https://ps.w.org/uk-cookie-consent/assets/icon.svg?rev=2567699)
 * [Termly - GDPR/CCPA Cookie Consent Banner](https://wordpress.org/plugins/uk-cookie-consent/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/uk-cookie-consent/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/uk-cookie-consent/)
 * [Active Topics](https://wordpress.org/support/plugin/uk-cookie-consent/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/uk-cookie-consent/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/uk-cookie-consent/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Krissieg](https://wordpress.org/support/users/krissieg/)
 * Last activity: [3 years, 10 months ago](https://wordpress.org/support/topic/preference-button-not-working/#post-15887714)
 * Status: resolved