Quick Note: Modify the WordPress Comments Cookie Consent in an Update-stable Way
It always bothered me that I could not modify the text (“Save my name, email, and website in this browser for the next time I comment.”) of the cookie consent checkbox in the WordPress comments section to explicitly mention that it uses cookies. I hate these “We use cookies – please accept” banners that bother you all the time, but of course I am really interested to stay compliant with GDPR and other laws. I found two solutions on the net:
The first is not update stable, since functions.php will potentially be overwritten by a theme update, and the second option considerably slows down the pages. And it is another plugin I need to hope that it does not contain a security issue…
Learning more about CSS, I found out that the modifications I wanted to have can be done using pure CSS, which I can add to the “Additional CSS” section in the Appearance menu of WordPress. Basically these lines did the trick:
1 2 |
.comment-form-cookies-consent label:before {content: "Optional: "} .comment-form-cookies-consent label:after {content: " (Uses cookies)"} |
Now it looks like this:

This should satisfy the requirement that the user can make an informed decision to use these cookies or not. And it is update stable!