Find out why your cookie settings link does nothing and make it open the Preferences Center
A link or button opens the TermsFeed Free Cookie Consent Preferences Center when it matches open_preferences_center_selector, or when your code calls cookieconsent.openPreferencesCenter() after Cookie Consent has started. The default selector is #open_preferences_center, the id of the "Update cookies preferences" link the generator writes. Visitors need this link to change or withdraw their answer, and without a working link a visitor who answered has no way on the page to do either.
Add "debug": true to the configuration object and publish the change, then run the checks with the Console tab open. A working setup prints Listening to clicks on: #open_preferences_center (or your own selector) on page load, and Preferences Center shown on each click.
Cause 1: The element does not match the selector
A click opens the Preferences Center only on an element matching the selector, or inside one, so a mistyped id, or a custom class that open_preferences_center_selector does not list, does nothing. Cookie Consent checks the selector on every click, so an element added after the page loaded works as well as one in the markup.
Right-click the link, choose Inspect, and compare its id or class with the selector in the Listening to clicks on: line. An id such as open_preference_center or open-preferences-center means a typo keeps the link from matching.
Correct the id to open_preferences_center. For a menu item whose editor has no id field, give it the class open-cookie-preferences and set "open_preferences_center_selector": "#open_preferences_center, .open-cookie-preferences" in the configuration, so the generator link keeps working. Find the menu item steps in Add a Cookie Settings Link.
Cause 2: open_preferences_center_selector is invalid
An invalid CSS selector in open_preferences_center_selector stops every element from opening the Preferences Center, while the consent banner keeps working. A stray quote, a stray ], or a class name that starts with a digit makes the selector invalid.
Debug mode prints Invalid open_preferences_center_selector, no element will open the Preferences Center: followed by your selector. Run document.querySelector(`.open-cookie-preferences`) in the Console tab, with your own selector in place of .open-cookie-preferences. The backticks keep the call working for a selector that holds quotes. An error from that call shows the selector is invalid.
Write a valid selector that keeps the default, such as "#open_preferences_center, .open-cookie-preferences", and reload. Inside the double-quoted option value, write attribute selectors with single quotes, such as a[href='#cookie-settings'].
Cause 3: Your code calls openPreferencesCenter before Cookie Consent starts
cookieconsent.openPreferencesCenter() exists only once Cookie Consent has started, so a call made earlier throws an error and opens nothing. Cookie Consent starts after DOMContentLoaded and after its file loads, so a call made while the page loads comes too early.
The Console tab shows Uncaught TypeError: cookieconsent.openPreferencesCenter is not a function. Call the function from a click handler, never on page load. A link matched by the selector does not throw such an error. A click on it before Cookie Consent starts opens nothing, and an href="#" link then jumps to the top of the page. Once Cookie Consent starts, the click opens the Preferences Center.
Cause 4: A script on your page stops the click first
Cookie Consent catches clicks on the document before they reach the link, so only a capture listener on window, or an earlier one on document with stopImmediatePropagation(), stops the click first. A script that registers such a listener and stops the click makes the link do nothing.
Open the Elements tab, select the link, and read the Event Listeners panel for click listeners on Window or document marked as capture. Skip the listener whose source is cookie-consent-code.js, or cookie-consent.js in a self-hosted copy, because that one is Cookie Consent itself. Change the other listener so it lets clicks on the link through, or remove the script that adds it, and reload.
Cause 5: Cookie Consent does not run on the page with the link
The selector works only on pages where Cookie Consent runs, so a link on a page without the Cookie Consent block does nothing. A privacy page, a landing page, or a checkout built from a separate template often lacks the block.
The page source does not hold cookie-consent.js, and the Console tab does not show a Cookie Consent line. Add the block to that template, and find the cause of a page without the block in Cookie Banner Not Appearing.
The Preferences Center opens with unexpected switches
The switches show the categories that run on page load until the visitor answers, then the saved answer, never unsaved toggles. Closing the Preferences Center with its close button or Escape discards the toggles made while it was open, and only the "Save my preferences" button stores them.
In express mode without page_load_consent_levels, every optional switch is off. Read the stored choice in the cookie_consent_level cookie with The 3 cookies Cookie Consent writes.
How to verify that the Preferences Center opens
A working link opens the Preferences Center on the first click, on every page, with no error in the console. Test the link after you answer the consent banner, as a returning visitor uses it. Once Cookie Consent runs, it prevents the default action of a matched link, so href="#" does not jump to the top of the page. Publish your change and clear any page cache first.
- Close every private window, open a new one, open DevTools with F12, and load a page with
"debug": truein the configuration. - Answer the consent banner, then click the "Update cookies preferences" link.
- Confirm that the "Cookies Preferences Center" opens and that the page does not jump.
- Open the Console tab and confirm the line
Preferences Center shownand no red error that points tocookie-consent-code.jsor namescookieconsent.