{"id":4230,"date":"2019-06-24T12:38:22","date_gmt":"2019-06-24T17:38:22","guid":{"rendered":"https:\/\/wpengine.com\/blog\/wordpress-cookies\/"},"modified":"2019-06-24T12:38:22","modified_gmt":"2019-06-24T17:38:22","slug":"wordpress-cookies","status":"publish","type":"post","link":"https:\/\/wpengine.com\/blog\/wordpress-cookies\/","title":{"rendered":"WordPress Cookies"},"content":{"rendered":"<p>You\u2019ve probably noticed that a lot of the websites you visit \u201cremember\u201d things about you. The information they store can be anything from your login credentials to items you\u2019ve browsed, articles you\u2019ve liked, and more.<\/p>\n\n\n\n<p>To do that, websites use what are called \u201ccookies.\u201d Cookies on the web enable sites to store key information safely within visitors\u2019 browsers. That way, they can provide a more personalized experience without putting user data at risk.<\/p>\n\n\n\n<p>In this article, we\u2019ll break down how cookies work and the ways WordPress in particular uses them. Then we\u2019ll teach you how to set up custom cookies in WordPress. Let\u2019s get to work!<\/p>\n\n\n\n<h2 id=\"toc-what-are-cookies-in-wordpress\" class=\"wp-block-heading\">What Are Cookies in WordPress?<\/h2>\n\n\n\n<p>Simply put, <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/kb.iu.edu\/d\/agwm\" target=\"_blank\" rel=\"noreferrer noopener\">cookies are files<\/a> that your website stores in visitors\u2019 browsers, which contain information about them. Here are some common examples of cookie use throughout the web:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Storing login credentials so users don\u2019t have to re-enter them each time they visit your site<\/li>\n\n\n\n<li>Remembering specific pages that visitors have been looking at lately (i.e., \u201cRecent products\u201d on <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"internal\" href=\"https:\/\/wpengine.com\/support\/best-practices-ecommerce-sites\/\" target=\"_blank\" rel=\"noreferrer noopener\">eCommerce sites<\/a>)<\/li>\n\n\n\n<li>Noting specific user behavior, such as when they last visited your site<\/li>\n<\/ul>\n\n\n\n<p>Cookies are everywhere on the web, to the extent that there\u2019s even <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/www.cookielaw.org\/the-cookie-law\/\" target=\"_blank\" rel=\"noreferrer noopener\">specific legislation<\/a> that governs how you can use them in some parts of the world.<\/p>\n\n\n\n<p>Overall, browsing the web would be a slower and less personal experience without cookies. Websites wouldn\u2019t be able to remember any of the information that makes your life easier. That\u2019s why WordPress is set up to use cookies out of the box.<\/p>\n\n\n\n<h2 id=\"toc-how-wordpress-uses-cookies\" class=\"wp-block-heading\">How WordPress Uses Cookies<\/h2>\n\n\n\n<p>By default, WordPress generates two types of cookies unless you tell it to do otherwise. Those include:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Session cookies.<\/strong> These are the ones that tell your browser: \u201cHey, we just logged into this site a while ago, so let\u2019s not close the session just yet\u201d. That saves you from having to log in over and over again on the same sites.<\/li>\n\n\n\n<li><strong>Comments cookies.<\/strong> Whenever you comment on a WordPress website, it will save some of your details so you don\u2019t have to re-enter them later on. That can include your username, email address, and more.<\/li>\n<\/ol>\n\n\n\n<p>It\u2019s important to reiterate that cookies reside within each user\u2019s browser. That means they\u2019re safe even if someone breaches the website\u2019s security, which is exactly why they\u2019re often used to handle sensitive information.<\/p>\n\n\n\n<h2 id=\"toc-how-wordpress-plugins-use-cookies\" class=\"wp-block-heading\">How WordPress Plugins Use Cookies<\/h2>\n\n\n\n<p>As you might imagine, WordPress plugins and other third-party tools also make extensive use of cookies. For example, if you use a <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"internal\" href=\"https:\/\/wpengine.com\/support\/disallowed-plugins\/#Related_Posts_Plugins\" target=\"_blank\" rel=\"noreferrer noopener\">related posts plugin<\/a>, it probably takes advantage of cookies to store information about which pages users have viewed.<\/p>\n\n\n\n<p>Likewise, <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"internal\" href=\"https:\/\/wpengine.com\/resources\/wordpress-analytics-and-stats-plugins\/\" target=\"_blank\" rel=\"noreferrer noopener\">analytics plugins<\/a> tend to use cookies to store user behavior data. In most cases, these cookies are harmless. However, these days you might need to <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/www.cookiebot.com\/en\/gdpr-cookies\/\" target=\"_blank\" rel=\"noreferrer noopener\">display a cookie notice<\/a> on your website, depending on where you do business.<\/p>\n\n\n\n<p>You\u2019ve probably seen these cookie notices all around the web, and it\u2019s no coincidence. People are more interested than ever in online privacy, so it only makes sense that many websites try to be as transparent as possible.<\/p>\n\n\n\n<h2 id=\"toc-how-to-set-cookies-in-wordpress-2-steps\" class=\"wp-block-heading\">How to Set Cookies in WordPress (2 Steps)<\/h2>\n\n\n\n<p>You\u2019ll need to use PHP to create and set up cookies in WordPress. Where you add the necessary code depends on whether you want to use your theme or a custom plugin. Let\u2019s take a look at how the first method works.<\/p>\n\n\n\n<h3 id=\"toc-step-1-open-your-themes-functions-php-file\" class=\"wp-block-heading\">Step 1: Open Your Theme\u2019s <em>functions.php <\/em>File<\/h3>\n\n\n\n<p>In most cases, the theme approach is the easiest route to take. To set a new cookie, you\u2019ll want to edit your active theme\u2019s <em>functions.php <\/em>file.<\/p>\n\n\n\n<p>First, <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/wordpress.org\/support\/article\/using-filezilla\/\" target=\"_blank\" rel=\"noreferrer noopener\">access your website via FTP<\/a> and navigate to the <em>public_html\/wp-content\/themes <\/em>directory. Inside, you\u2019ll find individual folders for each theme that\u2019s installed on your website.<\/p>\n\n\n\n<p>Open your active theme\u2019s folder, and look for the <em>functions.php <\/em>file inside. To add a custom cookie, you\u2019ll need to include some additional code within this file. Before that, however, you need to understand what parameters you can use:<br><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The name of the cookie<\/li>\n\n\n\n<li>Its value<\/li>\n\n\n\n<li>How long until it expires (it can\u2019t last forever!)<\/li>\n\n\n\n<li>Which pages the cookie will act on<\/li>\n\n\n\n<li>Your domain and\/or subdomains<\/li>\n\n\n\n<li>Whether it should transfer over <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"internal\" href=\"https:\/\/wpengine.com\/resources\/what-are-ssl-certificates\/\" target=\"_blank\" rel=\"noreferrer noopener\">HTTP or HTTPS<\/a><\/li>\n<\/ul>\n\n\n\n<p>We\u2019re going to use most of these parameters within the next section, so don\u2019t worry if you don\u2019t fully understand what each of them does just yet.<\/p>\n\n\n\n<h3 id=\"toc-step-2-add-your-new-cookies-code\" class=\"wp-block-heading\">Step 2: Add Your New Cookie\u2019s Code<\/h3>\n\n\n\n<p>Once you open the <em>functions.php <\/em>file, you\u2019ll be able to add custom code to it. Here\u2019s an example of the code you\u2019d use to add a new cookie:<br><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><em>function cookies_timestamp() {  <\/em><br><em>$visit_time = date('F j, Y &nbsp;g:i a');&nbsp; <\/em><br><em>if(!isset($_COOKIE[$visit_time])) {<\/em><br><em>setcookie('visit_time', $current_time, time()+86400);&nbsp;<\/em><br><em>}<\/em><br><em>}<\/em><br><\/pre>\n\n\n\n<p>That code includes three of the parameters we laid out in the last section. There\u2019s the cookie name (<em>cookies_timestamp<\/em>), its value (<em>visit_time<\/em>), and how long until it expires.<\/p>\n\n\n\n<p>What this particular cookie does is generate a timestamp of the last time someone visited your site. You might then use the cookie to display a message such as, \u201cYour last visit was on January 25th, 2019.\u201d This lets users know if someone else has accessed their account.<\/p>\n\n\n\n<p>As for the expiration time, you\u2019ll notice that it uses seconds. We set the value for a day, which is pretty short by cookie standards. The rest of the parameters don\u2019t matter as much, because the default options work well enough in almost every case.<\/p>\n\n\n\n<p>When you\u2019re done configuring your cookie, save the changes to <em>functions.php <\/em>and close it. Then, your cookie will start working right away!<\/p>\n\n\n\n<h2 id=\"toc-how-to-get-a-cookie-and-use-it-in\" class=\"wp-block-heading\">How to Get a Cookie and Use it in WordPress<\/h2>\n\n\n\n<p>In the last section, we talked about how you can use cookies in web development to pull up relevant user-specific data. There\u2019s a specific function you can use to \u2018get\u2019 cookies, so to speak.&nbsp;<br><\/p>\n\n\n\n<p>To use it, you\u2019ll need to edit your theme\u2019s <em>functions.php <\/em>file once more. Here\u2019s a quick example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><em>function get_cookie() { <\/em><br><em>$visit_time = date('F j, Y g:i a');<\/em><br><em>if(isset($_COOKIE['visit_time'])) {<\/em><br><em>function placeholder() {<\/em><br><em>}<\/em><br><em>}<\/em><br><em>}<\/em><br><\/pre>\n\n\n\n<p>In a nutshell, this creates a second function that checks to see if the <em>visit_time <\/em>cookie we created during the last section is there. If it is, then the code will execute a second function (the <em>placeholder <\/em>value), which we left blank for your benefit.<\/p>\n\n\n\n<h2 id=\"toc-deleting-a-cookie-in-wordpress\" class=\"wp-block-heading\">Deleting a Cookie in WordPress<\/h2>\n\n\n\n<p>Creating cookies is simple enough if you know what parameters to use. Plus, cookies expire with time (depending on the values you set). However, if there\u2019s a situation where you want to edit a cookie or you don\u2019t need it anymore, you can delete the original.<\/p>\n\n\n\n<p>To delete a cookie, you\u2019ll need to use the following code, which once again goes within your theme\u2019s <em>function.php <\/em>file:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><em>unset($_COOKIE['visit_time']);<\/em><\/pre>\n\n\n\n<p>As always, remember that we\u2019re using placeholders in our example. You\u2019ll want to modify that code depending on the specific cookie\u2019s name. Once you unset the cookie, you\u2019re free to replace it with a new version or leave it as is.<\/p>\n\n\n\n<h2 id=\"toc-cookies-the-wp-engine-digital-experience\" class=\"wp-block-heading\">Cookies &amp; the WP Engine Digital Experience <\/h2>\n\n\n\n<p>Cookies are one of the many ways modern websites can provide their users with a better experience. Using WordPress, you can configure cookies to personalize your site for each visitor.<\/p>\n\n\n\n<p>If you want to learn about other techniques for improving the user experience, check out <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"internal\" href=\"https:\/\/wpengine.com\/resources\/\" target=\"_blank\" rel=\"noreferrer noopener\">our developer resources<\/a>, where you can find dozens of guides and tutorials. While you\u2019re at it, improve your experience with a <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"internal\" href=\"https:\/\/wpengine.com\/wordpress-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\">host specifically optimized for WordPress<\/a>. <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"internal\" href=\"https:\/\/wpengine.com\/plans\/\" target=\"_blank\" rel=\"noreferrer noopener\">Take a look at our plans<\/a>\u2014chances are you\u2019ll find a great fit!<\/p>","protected":false},"excerpt":{"rendered":"<p>You\u2019ve probably noticed that a lot of the websites you visit \u201cremember\u201d things about you. The information they store can be anything from your login credentials to items you\u2019ve browsed, articles you\u2019ve liked, and more. To do that, websites use what are called \u201ccookies.\u201d Cookies on the web enable sites to store key information safely [&hellip;]<\/p>\n","protected":false},"author":15,"featured_media":2442,"comment_status":"","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"mediapress_draft_name":"","_mediapress_is_draft_copy":false,"_time_to_read":7,"footnotes":""},"audience":[],"blog-category":[121],"buyer-stage":[],"company-and-culture":[],"content-type":[54],"location":[],"persona":[106],"product":[],"topic":[100],"use-cases":[],"class_list":["post-4230","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","blog-category-best-practices","content-type-blog","persona-developer","topic-wordpress"],"acf":{"hero_image_alt_text":"","featured_on_hub_page":false,"featured_on_tag_page":false,"featured_on_category_page":false,"wp_engine_pick":false,"display_author_bio":false,"taxonomy_selector":{"":null,"taxonomy-audience":false,"taxonomy-buyer-stage":false,"taxonomy-company-and-culture":false,"taxonomy-content-type":[54],"taxonomy-location":false,"taxonomy-persona":[106],"taxonomy-product":false,"taxonomy-topic":[100],"taxonomy-use-cases":false}},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>WordPress Cookies Guide<\/title>\n<meta name=\"description\" content=\"Understand what WordPress cookies are, how they work, how they can impact site performance, and how to add cookies to your WordPress site.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wpengine.com\/blog\/wordpress-cookies\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"WordPress Cookies Guide\" \/>\n<meta property=\"og:description\" content=\"Understand what WordPress cookies are, how they work, and how they can impact your website and visitors and how to add cookies to your WordPress site. Check out the WP Engine WordPress Cookies Guide.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wpengine.com\/blog\/wordpress-cookies\/\" \/>\n<meta property=\"og:site_name\" content=\"WP Engine\u00ae\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/wpengine\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-06-24T17:38:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wpengine.com\/wp-content\/uploads\/2025\/09\/WPE-IMG-Thumbnail-1200x630-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Erin Myers\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"WordPress Cookies Guide\" \/>\n<meta name=\"twitter:description\" content=\"Understand what WordPress cookies are, how they work, and how they can impact your website and visitors and how to add cookies to your WordPress site. Check out the WP Engine WordPress Cookies Guide.\" \/>\n<meta name=\"twitter:creator\" content=\"@wpengine\" \/>\n<meta name=\"twitter:site\" content=\"@wpengine\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Erin Myers\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-cookies\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-cookies\\\/\"},\"author\":{\"name\":\"Erin Myers\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/#\\\/schema\\\/person\\\/e317e5c0dfa4fca60914f6c1dfde2e0e\"},\"headline\":\"WordPress Cookies\",\"datePublished\":\"2019-06-24T17:38:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-cookies\\\/\"},\"wordCount\":1271,\"publisher\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-cookies\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wpengine.com\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/cookies-header.png\",\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-cookies\\\/\",\"url\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-cookies\\\/\",\"name\":\"WordPress Cookies Guide\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-cookies\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-cookies\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wpengine.com\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/cookies-header.png\",\"datePublished\":\"2019-06-24T17:38:22+00:00\",\"description\":\"Understand what WordPress cookies are, how they work, how they can impact site performance, and how to add cookies to your WordPress site.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-cookies\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-cookies\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-cookies\\\/#primaryimage\",\"url\":\"https:\\\/\\\/wpengine.com\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/cookies-header.png\",\"contentUrl\":\"https:\\\/\\\/wpengine.com\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/cookies-header.png\",\"caption\":\"a plate of cookies next to a computer. WordPress cookies\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-cookies\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/wpengine.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WordPress Cookies\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/#website\",\"url\":\"https:\\\/\\\/wpengine.com\\\/\",\"name\":\"WP Engine\u00ae\",\"description\":\"Managed Hosting for WordPress\",\"publisher\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/wpengine.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/#organization\",\"name\":\"WP Engine\",\"url\":\"https:\\\/\\\/wpengine.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/wpengine.com\\\/wp-content\\\/uploads\\\/2025\\\/09\\\/WPEngine_OGImage-1.webp\",\"contentUrl\":\"https:\\\/\\\/wpengine.com\\\/wp-content\\\/uploads\\\/2025\\\/09\\\/WPEngine_OGImage-1.webp\",\"width\":1200,\"height\":630,\"caption\":\"WP Engine\"},\"image\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/wpengine\\\/\",\"https:\\\/\\\/x.com\\\/wpengine\",\"https:\\\/\\\/www.instagram.com\\\/wpengine\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/wpengine\\\/\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCJeAEAxX69v24CUBZ0WBYSg\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/#\\\/schema\\\/person\\\/e317e5c0dfa4fca60914f6c1dfde2e0e\",\"name\":\"Erin Myers\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cd881e115bc28c81642ec61752db9981ece9ee8b4c81498a9b6276b9cdcaf5e6?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cd881e115bc28c81642ec61752db9981ece9ee8b4c81498a9b6276b9cdcaf5e6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cd881e115bc28c81642ec61752db9981ece9ee8b4c81498a9b6276b9cdcaf5e6?s=96&d=mm&r=g\",\"caption\":\"Erin Myers\"},\"url\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/author\\\/erin-myers\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"WordPress Cookies Guide","description":"Understand what WordPress cookies are, how they work, how they can impact site performance, and how to add cookies to your WordPress site.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wpengine.com\/blog\/wordpress-cookies\/","og_locale":"en_US","og_type":"article","og_title":"WordPress Cookies Guide","og_description":"Understand what WordPress cookies are, how they work, and how they can impact your website and visitors and how to add cookies to your WordPress site. Check out the WP Engine WordPress Cookies Guide.","og_url":"https:\/\/wpengine.com\/blog\/wordpress-cookies\/","og_site_name":"WP Engine\u00ae","article_publisher":"https:\/\/www.facebook.com\/wpengine\/","article_published_time":"2019-06-24T17:38:22+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/wpengine.com\/wp-content\/uploads\/2025\/09\/WPE-IMG-Thumbnail-1200x630-1.jpg","type":"image\/jpeg"}],"author":"Erin Myers","twitter_card":"summary_large_image","twitter_title":"WordPress Cookies Guide","twitter_description":"Understand what WordPress cookies are, how they work, and how they can impact your website and visitors and how to add cookies to your WordPress site. Check out the WP Engine WordPress Cookies Guide.","twitter_creator":"@wpengine","twitter_site":"@wpengine","twitter_misc":{"Written by":"Erin Myers","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/wpengine.com\/blog\/wordpress-cookies\/#article","isPartOf":{"@id":"https:\/\/wpengine.com\/blog\/wordpress-cookies\/"},"author":{"name":"Erin Myers","@id":"https:\/\/wpengine.com\/#\/schema\/person\/e317e5c0dfa4fca60914f6c1dfde2e0e"},"headline":"WordPress Cookies","datePublished":"2019-06-24T17:38:22+00:00","mainEntityOfPage":{"@id":"https:\/\/wpengine.com\/blog\/wordpress-cookies\/"},"wordCount":1271,"publisher":{"@id":"https:\/\/wpengine.com\/#organization"},"image":{"@id":"https:\/\/wpengine.com\/blog\/wordpress-cookies\/#primaryimage"},"thumbnailUrl":"https:\/\/wpengine.com\/wp-content\/uploads\/2019\/06\/cookies-header.png","inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/wpengine.com\/blog\/wordpress-cookies\/","url":"https:\/\/wpengine.com\/blog\/wordpress-cookies\/","name":"WordPress Cookies Guide","isPartOf":{"@id":"https:\/\/wpengine.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/wpengine.com\/blog\/wordpress-cookies\/#primaryimage"},"image":{"@id":"https:\/\/wpengine.com\/blog\/wordpress-cookies\/#primaryimage"},"thumbnailUrl":"https:\/\/wpengine.com\/wp-content\/uploads\/2019\/06\/cookies-header.png","datePublished":"2019-06-24T17:38:22+00:00","description":"Understand what WordPress cookies are, how they work, how they can impact site performance, and how to add cookies to your WordPress site.","breadcrumb":{"@id":"https:\/\/wpengine.com\/blog\/wordpress-cookies\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wpengine.com\/blog\/wordpress-cookies\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpengine.com\/blog\/wordpress-cookies\/#primaryimage","url":"https:\/\/wpengine.com\/wp-content\/uploads\/2019\/06\/cookies-header.png","contentUrl":"https:\/\/wpengine.com\/wp-content\/uploads\/2019\/06\/cookies-header.png","caption":"a plate of cookies next to a computer. WordPress cookies"},{"@type":"BreadcrumbList","@id":"https:\/\/wpengine.com\/blog\/wordpress-cookies\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wpengine.com\/"},{"@type":"ListItem","position":2,"name":"WordPress Cookies"}]},{"@type":"WebSite","@id":"https:\/\/wpengine.com\/#website","url":"https:\/\/wpengine.com\/","name":"WP Engine\u00ae","description":"Managed Hosting for WordPress","publisher":{"@id":"https:\/\/wpengine.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wpengine.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/wpengine.com\/#organization","name":"WP Engine","url":"https:\/\/wpengine.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpengine.com\/#\/schema\/logo\/image\/","url":"https:\/\/wpengine.com\/wp-content\/uploads\/2025\/09\/WPEngine_OGImage-1.webp","contentUrl":"https:\/\/wpengine.com\/wp-content\/uploads\/2025\/09\/WPEngine_OGImage-1.webp","width":1200,"height":630,"caption":"WP Engine"},"image":{"@id":"https:\/\/wpengine.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/wpengine\/","https:\/\/x.com\/wpengine","https:\/\/www.instagram.com\/wpengine\/","https:\/\/www.linkedin.com\/company\/wpengine\/","https:\/\/www.youtube.com\/channel\/UCJeAEAxX69v24CUBZ0WBYSg"]},{"@type":"Person","@id":"https:\/\/wpengine.com\/#\/schema\/person\/e317e5c0dfa4fca60914f6c1dfde2e0e","name":"Erin Myers","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/cd881e115bc28c81642ec61752db9981ece9ee8b4c81498a9b6276b9cdcaf5e6?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/cd881e115bc28c81642ec61752db9981ece9ee8b4c81498a9b6276b9cdcaf5e6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cd881e115bc28c81642ec61752db9981ece9ee8b4c81498a9b6276b9cdcaf5e6?s=96&d=mm&r=g","caption":"Erin Myers"},"url":"https:\/\/wpengine.com\/blog\/author\/erin-myers\/"}]}},"mediapress_workflow_parent_id":null,"_links":{"self":[{"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/posts\/4230","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/comments?post=4230"}],"version-history":[{"count":0,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/posts\/4230\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/media\/2442"}],"wp:attachment":[{"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/media?parent=4230"}],"wp:term":[{"taxonomy":"audience","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/audience?post=4230"},{"taxonomy":"blog-category","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/blog-category?post=4230"},{"taxonomy":"buyer-stage","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/buyer-stage?post=4230"},{"taxonomy":"company-and-culture","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/company-and-culture?post=4230"},{"taxonomy":"content-type","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/content-type?post=4230"},{"taxonomy":"location","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/location?post=4230"},{"taxonomy":"persona","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/persona?post=4230"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/product?post=4230"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/topic?post=4230"},{"taxonomy":"use-cases","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/use-cases?post=4230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}