📥 My Awesome Plugin
This plugin helps you automate tasks and improve web performance.
⬇️ Download Plugin ZIP💌 Subscribe to Updates
Free plugin for Page Password Protector
Page Password Protector” free plugin that allows non-coders to easily add password protection to any page or post via a simple interface. The plugin will add a meta box to the page/post editor where users can set a password, and it will restrict access to the content unless the correct password is entered. The plugin will be lightweight, secure, and easy to set up, requiring only activation and no coding knowledge.
- Upload to WordPress:
- Zip the wp-page-password-protector folder.
- In your WordPress admin dashboard, go to Plugins > Add New > Upload Plugin.
- Upload the zipped folder and click Install Now.
- Activate the Plugin:
- After installation, click Activate Plugin.
- Add Password Protection:
- Edit any page or post in the WordPress editor.
- In the right sidebar, find the Page Password Protection meta box.
- Enter a password in the text field and save the page/post. Leave it blank to disable protection.
- Visitors will see a password form when accessing the protected page/post.
- View Instructions (Optional):
- In the WordPress admin dashboard, a new menu item called Password Protector will appear for administrators.
- Click it for detailed instructions on using the plugin.
Features
- Password Protection: Easily add a password to any page or post via the editor.
- User-Friendly: Adds a meta box to the page/post editor for setting passwords.
- Secure Access: Uses session-based authentication to grant access after correct password entry.
- Simple Form: Displays a clean, styled password entry form for visitors.
- Admin Instructions: Includes an admin page with usage instructions.
- Single File: All functionality, including styles, is contained in one PHP file.
- Secure: Uses WordPress best practices for data sanitization, nonce verification, and session handling.
How It Works
- A meta box is added to the page/post editor where you can set a password.
- If a password is set, the plugin replaces the content with a password entry form for visitors.
- When the correct password is entered, the content is displayed, and access is stored in a session to avoid repeated password entry during the same browser session.
- Incorrect password attempts show an error message.
- Passwords are stored securely in the post meta, and all inputs are sanitized to prevent vulnerabilities.
Notes
- The plugin uses PHP sessions to track access, which are started automatically.
- Password protection applies only to the main content of the page/post (not sidebars, headers, or footers).
- Only users with edit permissions can set passwords.
- The plugin is lightweight and compatible with WordPress 5.0 and above.
- If you leave the password field blank, the page/post becomes publicly accessible.
This Free plugin is ready to use and provides a straightforward way to password-protect pages and posts. Let me know if you need additional features (e.g., custom form styling, multiple passwords, or protection for specific user roles) or help with setup!