{"id":40254,"date":"2021-07-08T10:05:24","date_gmt":"2021-07-08T14:05:24","guid":{"rendered":"https:\/\/www.boldgrid.com\/support\/?p=40254"},"modified":"2024-01-10T17:36:07","modified_gmt":"2024-01-10T22:36:07","slug":"edit-the-wordpress-password-protected-page","status":"publish","type":"post","link":"https:\/\/www.boldgrid.com\/support\/wordpress-tutorials\/edit-the-wordpress-password-protected-page\/","title":{"rendered":"Edit the WordPress Password Protected Page"},"content":{"rendered":"<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<?xml encoding=\"utf-8\" ?><html><body><div class=\"video-responsive\">\n<p><iframe loading=\"lazy\" title=\"How to Edit the Password Protected Page in WordPress.\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/tVvluLzXzpQ?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<\/div>\n<p>Sometimes you don&rsquo;t want your entire <a href=\"https:\/\/www.boldgrid.com\/\">WordPress website<\/a> shown to all users. Luckily WordPress can password protect pages or posts using Core functionality. If you want users to register or hide from the public for privacy reasons, this can be a great solution.<\/p>\n<p>To enable the WordPress password protected page feature, please follow these instructions:<\/p>\n<ul>\n<li aria-level=\"1\">Open the page or post you want to protect<\/li>\n<li aria-level=\"1\">In the <b>Publish <\/b>metabox there is a <b>Visibility <\/b>option<\/li>\n<li aria-level=\"1\">Choose <b>Password protected<\/b> in the dropdown<\/li>\n<li aria-level=\"1\">Enter the password you wish your users to enter to access the content<\/li>\n<li aria-level=\"1\">Click the blue <b>Publish <\/b>to save your changes<\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2021\/07\/wordpress-password-protected-setting.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-40255\" src=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2021\/07\/wordpress-password-protected-setting.png\" alt=\"WordPress Password Protected Page Settings\" width=\"264\" height=\"530\" srcset=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2021\/07\/wordpress-password-protected-setting.png 264w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2021\/07\/wordpress-password-protected-setting-149x300.png 149w\" sizes=\"auto, (max-width: 264px) 100vw, 264px\" \/><\/a><\/p>\n<p>Each page and post can have a unique password, or they can all be the same. With this method each user cannot have their own password. If you want unique passwords per user, you will need to have your users register. You can also use a plugin, which we will discuss later in this article.<\/p>\n<h2 id=\"customize-the-password-protected-page-in-wordpress\">Customize the Password Protected Page in WordPress<\/h2>\n<p>Next you may want to change the password protected message that displays. By default the message reads:<\/p>\n<p><b>This content is password protected. To view it please enter your password below:<\/b><\/p>\n<p>To change this message, you can use a plugin like<a href=\"https:\/\/wordpress.org\/plugins\/password-protect-page\/\"> WordPress Password Protect Page<\/a>. It lets you edit the form in the WordPress Customizer and provides other useful options.<\/p>\n<p>If you are selling memberships or access to your content, you&rsquo;ll need a plugin like<a href=\"https:\/\/wordpress.org\/plugins\/paid-memberships-pro\/\"> Paid Memberships Pro<\/a>. It is widely used and provides a lot more tools to promote your paid content.<\/p>\n<p>Those looking for a customizable PHP implementation can use custom code. In your child theme, or using a plugin like<a href=\"https:\/\/wordpress.org\/plugins\/code-snippets\"> Code Snippets,<\/a> you can modify the password form with a filter.<\/p>\n<p>Here&rsquo;s the code you can customize:<\/p>\n<pre>function my_custom_password_form() {\r\n\t\tglobal $post;\r\n\t\t$label = 'pwbox-' . ( empty( $post-&gt;ID ) ? rand() : $post-&gt;ID );\r\n\t\t$output = '\r\n\t\t&lt;div class=\"boldgrid-section\"&gt;\r\n\t\t\t&lt;div class=\"container\"&gt;\r\n\t\t\t\t&lt;form action=\"' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '\" class=\"form-inline post-password-form\" method=\"post\"&gt;\r\n\t\t\t\t\t&lt;p&gt;' . __( 'This content is password protected. This is a custom message. To view it please enter your password below:' ) . '&lt;\/p&gt;\r\n\t\t\t\t\t&lt;label for=\"' . $label . '\"&gt;' . __( 'Password:' ) . ' &lt;input name=\"post_password\" id=\"' . $label . '\" type=\"password\" size=\"20\" class=\"form-control\" \/&gt;&lt;\/label&gt;&lt;button type=\"submit\" name=\"Submit\" class=\"button-primary\"&gt;' . esc_attr_x( 'Enter', 'post password form' ) . '&lt;\/button&gt;\r\n\t\t\t\t&lt;\/form&gt;\r\n\t\t\t&lt;\/div&gt;\r\n\t\t&lt;\/div&gt;';\r\n\treturn $output;\r\n}\r\nadd_filter('the_password_form', 'my_custom_password_form', 99);<\/pre>\n<p>We hope this helps you better work with password protected pages in WordPress. Please let us know your thoughts in the comments below.<\/p>\n<\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes you don&rsquo;t want your entire WordPress website shown to all users. Luckily WordPress can password protect pages or posts using Core functionality. If you want users to register or hide from the public for privacy reasons, this can be a great solution. To enable the WordPress password protected page feature, please follow these instructions: [&hellip;]<\/p>\n","protected":false},"author":215,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"bgseo_title":"How to Edit the WordPress Password Protected Page","bgseo_description":"Learn how to change the WordPress password protected page. By default it reads This content is password protected. To view it please enter your password below:","bgseo_robots_index":"index","bgseo_robots_follow":"follow","footnotes":""},"categories":[151],"tags":[],"class_list":["post-40254","post","type-post","status-publish","format-standard","hentry","category-wordpress-tutorials"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts\/40254","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/users\/215"}],"replies":[{"embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/comments?post=40254"}],"version-history":[{"count":6,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts\/40254\/revisions"}],"predecessor-version":[{"id":122536,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts\/40254\/revisions\/122536"}],"wp:attachment":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/media?parent=40254"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/categories?post=40254"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/tags?post=40254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}