How Do I Add a Cookie Policy to a WordPress Site?

Adding a cookie policy to a WordPress site is fairly easy. First, create a new file called wp-config.php and add the following line to the file:

define(‘COOKIE_POLICY’, ‘Your Cookie Policy’);

Next, open the wp-config.php file in a text editor and add the following lines to it:

/*

WordPress

*/

define(‘DB_CONNECTION’, ‘mysql’);

define(‘DB_HOST’, ‘localhost’);

define(‘DB_USER’, ‘username’);

define(‘DB_PASSWORD’, ‘password’);

define(‘COOKIE_DOMAIN’, ‘yourdomain.com’);

define(‘COOKIE_PATH’, ‘/’);

define(‘COOKIE_NAME’, ‘WordPress_cron’);

define(‘COOKIE_SESSION’, ‘WordPress_cron’);

define(‘COOKIE_TMP’, ‘tmp_cookies’);

define(‘COOKIE_HTTPONLY’, false);

define(‘COOKIE_HTTPONLY_SECURE’, false);

define(‘COOKIE_HTTPONLY_SESSION’, false);

define(‘COOKIE_HTTPONLY_CACHE’, false);

define(‘COOKIE_HTTPONLY_FILES’, false);

define(‘COOKIE_HTTPONLY_BROWSER_IDS’, false);

define(‘COOKIE_HTTPONLY_COOKIE_DOMains’, false);

define(‘COOKIE_HTTPONLY_COOKIE_Paths’, false);

define(‘COOKIE_HTTPONLY_COOKIE_Names’, false);

define(‘COOKIE_HTTPONLY_COOKIE_Sizes’, false);

define(‘COOKIE_HTTPONLY_HTTP_METHODS’, false);

define(‘COOKIE_HTTPONLY_HTTPS’, false);

define(‘COOKIE_HTTPONLY_SSL’, false);

define(‘COOKIE_HTTPONLY_SESSION_COOKIE’, false);

define(‘COOKIE_HTTPONLY_SECURE_COOKIE’, false);

define(‘COOKIE_HTTPONLY_CACHE_FILE’, ‘/tmp/cookies’);

define(‘COOKIE_HTTPONLY_CACHE_SIZE’, 524288);

define(‘COOKIE_HTTPONLY_CACHE_TIMEOUT’, 3600);

define(‘COOKIE_HTTPONLY_MAX_SESSIONS’, 5);

define(‘COOKIE_HTTPONLY_HTTP_ACCEPT’, ‘text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8′);

define(‘COOKIE_HTTPONLY_HTTP_VERSION’, ‘1.1’);

define(‘COOKIE_HTTPONLY_SSL_VERSION’, ‘1.0’);

define(‘COOKIE_HTTPONLY_SESSION_COOKIE_SECURE’, false);

define(‘COOKIE_HTTPONLY_SECURE_COOKIE_SECURE’, false);

wp-settings.php

define(‘COOKIE_DOMAIN’, ‘WordPress.com’);

define(‘COOKIE_SESSION’, true);.