WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to create a custom plugin that will change the way that wordpress names its cookings. Specifically, I want to write my own version of wp_user_settings().

I know I probably shouldn't hack core, so where is the best place to hook in to rewrite the function?

share|improve this question

Short answer: You can't. That's not hookable for the settings cookies.

You can adjust the cookie paths and such via defines, so as to make the settings apply across multiple installations across a domain. The most common use of this is to make logins work across a domain, so when you log into one, you log into all subdomain installs as well.

The basic code you need here is this in the wp-config file:

define('LOGGED_IN_COOKIE', 'login_cookie_name');
define('COOKIE_DOMAIN', '.example.com');
define('COOKIEHASH', 'random_hash_here');

Put that in the config across multiple sites, set the keys and salts to be the same, and you'll have login cookies that work across the domain and subdomains.

Multisite is simpler.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.