• Skip to primary navigation
  • Skip to main content
OsomCode

OsomCode

Awesome code tutorials for WordPress and Genesis

  • Subscribe
  • My account
    • Edit profile
    • Favorites
    • Update credit card
  • Login

Customize the text of password-protected pages in WordPress

Learn in this tutorial how to customize the text of WordPress password protected pages using code.

WordPress allows you to password protect pages, which can be very handy if you need something simple.

The limitation is that, by default, it displays a text that can be a bit confusing for the visitor.

Text-default-page-protected-password-WordPress
Default WordPress password protected page text.

But luckily you can modify this text to your liking thanks to a WordPress filter.

And here’s how:

Snippet to customize the text of a password protected page in WordPress

Add the following code at the end of functions.php or in your functionality plugin:

To see this and another 839 code snippets of this website, login or subscribe here.

With this block you use the_password_form filter to modify the default text and customize it.

Custom-text-page-protected-password-WordPress
Custom text WordPress password protected page

Obviously, you can replace the text with the one that suits you.

Conclusions

Now you know how to customize the text of a password protected page in WordPress.

Any questions? I read you in the comments.

And if you want to give me any suggestion for future tutorials, leave it in the contact form. Advantages of being a subscriber. 😉

PHP WordPress

To leave read and make questions about this code, you can login or register.

  • About OsomCode
  • FAQ
  • Contact

Legal Notice · Privacy Policy · Cookie Policy · Terms and conditions
Copyright © 2023

Lost your password?