Home > Docs > GDPR Cookie Consent(Legacy Version) > Modifying Cookie Consent Duration of your WordPress Site

Modifying Cookie Consent Duration of your WordPress Site

Last updated on June 14, 2023

By default, the GDPR Cookie Consent plugin preserves the cookie consent for a duration of 365 days. But, it is likely that, you may want to modify this default behavior. To do that, simply add the below given code snippet into the functions.php of the active child theme.

  • Go to Appearance > Theme editor > functions.php
  • Add the below given code snippet.

Adding the above code snippet will ask the user for consent within a duration of every 30 days. You can replace the value 30 with the required number of days within the code to repeat the cookie consent within that time interval.