Discover in this tutorial how to display a different message in the Restrict Content Pro box on a specific page using code.
By default, Restrict Content Pro (one of the most popular plugins for restricting content) only allows you to set a single restriction message from the settings area to appear over paid content if the user is not logged in.
But what if you want to show a different text on a specific page?
You can achieve this easily thanks to a filter in the plugin:
Change the Restrict Content Pro message on a specific page
Add the following code at the end of functions.php or in your functionality plugin:
You got it.
In this case the page had the ID 4364 but you can change it to whatever you need.
You can get the page ID by checking the URL when you edit the page or, if you want to make it easier for yourself, get it displayed directly in the WordPress admin with this tutorial.
In the same way, you can replace the text with the one that suits you. 😉
Now you know how to modify the text displayed by Restrict Content Pro on a given page using code.
If you have any question, please leave it in the comments. And if you want to give me a suggestion for future snippets, please send it through the contact form.
Benefits of being a subscriber. 🙂