Ottawa West Four Rivers Ontario Health Team

OWFR Password Page
Technical Reference

How the branded password-protection layer works on the Ottawa West Four Rivers Ontario Health Team website.

Plugin version 1.0.0 April 2026
← All Guides
1

What this plugin does

The OWFR Password Page plugin replaces the default WordPress password-protected page form with a visually branded OWFR layout. When a visitor arrives at any WordPress page that has been set to Password Protected, instead of the plain, unstyled default form they see a full-page card that matches the OWFR visual identity.

The plugin has no admin settings page, no shortcode, and no dashboard. It works automatically on every password-protected page across the site with no configuration required.

Scope: entire site. Once the plugin is active, the branded form applies to every page on the site that uses WordPress's built-in Password Protection visibility setting. There is no per-page toggle.
2

How it works

The plugin uses two parallel interception strategies to ensure the branded form is displayed regardless of which WordPress theme is active.

Strategy 1: Template override (primary, for Divi)

The OWFR website uses the Divi theme. Divi bypasses WordPress's standard the_password_form filter by rendering password pages through its own template system. To handle this, the plugin hooks into template_include at priority 999 (very late) and checks whether the current page is a singular post that requires a password. If so, it loads owfr-password-template.php from the plugin folder instead of Divi's template, rendering a complete standalone HTML page.

Strategy 2: Filter fallback (for non-Divi themes)

For themes that use the standard WordPress password form, the plugin also hooks into the_password_form and replaces the default form output with the same branded HTML. This ensures compatibility if the theme ever changes.

Both strategies call the same internal function, owfr_render_password_form(), which generates the complete branded form HTML. This means the visual output is identical regardless of which interception path was used.

Title prefix removal

WordPress automatically prepends "Protected: " to the title of password-protected pages. The plugin hooks into the_title filter to silently strip this prefix, keeping page titles clean.

3

Form components

The branded form renders a centered card on a full-page background. The card contains the following elements in order:

Element Description
OWFR logo The OWFR colour bilingual logo, loaded from the WordPress media library at /wp-content/uploads/2026/02/OWFR-colour-bilingual-large.png.
Lock icon An inline SVG padlock icon. No external icon font required.
Heading "Protected Content" as an h2 element.
Description A brief sentence instructing the user to enter the password.
Error message Shown conditionally when a wrong password has been submitted. See Section 4.
Password input A styled type="password" input with placeholder text. Includes autofocus, autocomplete="off", and spellcheck="false" attributes.
Show/hide toggle A button inside the input field that toggles between visible and hidden password text. Uses two inline SVG eye icons (open and closed). Managed by owfr-password-page.js.
Submit button An "Unlock" button with an inline SVG padlock icon. Posts the form to wp-login.php?action=postpass.
Hint text A footer note below the form: "If you don't have the password, please contact your organization's administrator."
4

Error state and wrong password

WordPress handles password verification by setting a browser cookie named wp-postpass_{COOKIEHASH} when a password is submitted. If the password is wrong, the cookie is set with an invalid hash and the browser is redirected back to the password page.

The plugin detects this state by checking for the presence of that cookie on page load. If the cookie exists (meaning a failed attempt has already been made), the plugin:

No brute-force protection built in. The plugin does not implement any rate limiting or lockout for repeated wrong password attempts. WordPress's native cookie-based password handling is used as-is. If protection against brute-force attempts is required, this would need to be handled at the server or firewall level.
5

Stylesheets and scripts

The plugin enqueues its assets conditionally: they are only loaded when the current page is a singular post that requires a password. They are never loaded on other pages.

File Handle Purpose
owfr-password-page.css owfr-password-page All visual styling for the password card, input, button, toggle, and error state. Self-contained: no dependency on the theme's stylesheet.
owfr-password-page.js owfr-password-page Powers the show/hide password toggle button. Loaded in the footer (in_footer: true). No dependencies on jQuery or any other library.
The template path bypasses normal asset enqueuing. When the template override path is active (Strategy 1 for Divi), the full-page template owfr-password-template.php outputs a complete HTML document and includes the styles inline or via a direct link. The wp_enqueue_scripts hook may not fire in this path. The template handles its own asset loading.
6

WordPress hooks used

Filter
template_include

Intercepts the theme template at priority 999. Replaces Divi's template with the plugin's own full-page template when a password is required.

Filter
the_password_form

Fallback for non-Divi themes. Replaces the standard WordPress password form with the branded HTML output.

Action
wp_enqueue_scripts

Conditionally enqueues owfr-password-page.css and owfr-password-page.js only on pages where a password is required.

Filter
the_title

Strips the "Protected: " prefix from the page title when the page requires a password. Applied at priority 10.

7

Plugin files

8

Setting a page as password-protected

The plugin activates automatically for any WordPress page with the built-in Password Protected visibility setting. No shortcode or special configuration is required.

To password-protect a page in WordPress:

  1. Open the page in the WordPress block editor.
  2. In the right panel under Summary, find the Visibility setting (default is "Public").
  3. Click Visibility, select Password Protected, and enter the password.
  4. Click Update to save the page.

Once saved, any visitor who navigates to that page will see the OWFR branded password form automatically. The password is set per-page and can be different for each protected page on the site.

Communicating the password to users. WordPress does not provide a built-in way to email passwords to users. If a page is password-protected for a specific audience (such as internal partners), the password must be communicated externally, for example via email, a committee notice, or a staff announcement.

OWFR Password Page Plugin  |  Ottawa West Four Rivers Ontario Health Team  |  April 2026

← All Guides