Tulipe Media

Réflexions entrepreneuriales

How to customize the comment cookie expiration time in WordPress

In WordPress, the default comment cookie expiration time is up to 30 000 000 seconds. That’s very long, especially for bloggers who are using cache plugins like W3 Total Cache. In fact, this plugin is not caching pages for visitors who have left comments on your blog, because of cookies, and until the cookie is cleared the plugin informs that cookie is rejected.
If you want to reduce the comment cookie expiration time, you have to play with the comment_cookie_lifetime filter in your functions.php file. You may set the expiration time you want, I chose 259 200 seconds in this example.
[icon style= »chain » color= »red »]functions.php[/icon]
[code]
add_filter(‘comment_cookie_lifetime’, ‘my_comment_cookie_lifetime’);
function my_comment_cookie_lifetime($lifetime) {
return 259200;
}
[/code]
Via

 

Mes derniers tweets

Nouveau short sur Blooness 👉 La formation dédiée aux meilleures graines oléagineuses pour la santé est enfin disponible au format audio https://buff.ly/3xo9fTS
https://buff.ly/43DkrYR

Nouveau short sur Blooness 👉 S’il n’y avait qu’un supplément à prendre, ce serait le magnésium (avec la vitamine D). Le guide complet des meilleurs multivitamines du marché toujours dispo ici en accès libre https://buff.ly/49bHqvp
https://buff.ly/49c3rKK

Nouveau short sur Blooness 👉 La dernière formation Blooness sur les #protéines est disponible au format audio https://buff.ly/4aijbMW
https://buff.ly/3TP67cB

Charger plus

Ne manquez pas les conseils business par mail

Pas de spam, juste un mail lorsqu'un nouveau contenu est publié.

Une réponse

  1. I am really impressed with your writing skills as well as with the layout on your weblog.
    Is this a paid theme or did you modify it yourself?
    Either way keep up the excellent quality writing, it is rare to
    see a nice blog like this one these days.

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

fr_FRFR