Using the following snippet, you will be able to redirect users to a random post in WordPress.

Snippet Source/Credit: Smashing Magazine