Create splash page using COOKIE – WordPress

Some found this not useful, creating splash page is useless, but for some, it depends on the need, say for example for liquor site that requires at least 18 years old before they can access into the main site so they need to confirm that they are 18 years old or above(no guarantee), this method is also helpful to check for old and new site visitors, a great example is displaying recently published posts for old visitors and display lists of good information where to begin with for new visitors or something like that.

Without further ado lets get started.


I’m sure you already know PHP before you came into WordPress world, so creating cookie is same format and syntax as in the PHP, see below with default format.


For this we’re going to use action hook “template_redirect” to check for new visitors

Full Code

Add this code into your theme functions.php file.

That’s it, now we have running splash page, don’t hesitate to share your idea.

Happy coding ^_^

by Ryan Sutana