Back to Community

How to Fix the Long, Unfriendly Password Protected Login URL

19 threads Sep 9, 2025

Content

Many users of the 'Password Protected' plugin encounter a long, SEO-unfriendly URL when accessing their protected site. The URL typically looks something like this:

https://yourdomain.com/?password-protected=login&redirect_to=https%3A%2F%2Fyourdomain.com%2F

This article explains why this happens and explores the common solutions and workarounds available.

Why Does This Long URL Appear?

The long query string is a fundamental part of how the 'Password Protected' plugin functions. The two main parameters are:

  • password-protected=login: This tells WordPress to load the plugin's password form.
  • redirect_to=...: This is a URL-encoded version of the page the user was originally trying to access. After a successful login, the plugin uses this parameter to send the user to their intended destination.

This behavior is by design and is not a bug. The redirect parameter is generally required for the plugin to work correctly, ensuring users end up on the right page after entering the password.

Common Solutions and Workarounds

1. Use a Custom Code Snippet (For Developers)

The plugin's developer has acknowledged this concern. A future version is expected to include a filter hook, password_protected_login_redirect_url, which will allow developers to modify the redirect behavior. This filter could be used to always redirect users to the site's homepage after login instead of the original URL, which would simplify the login URL.

2. Manually Exclude Problematic URLs

If the long URL is causing issues when shared on social media platforms like Facebook (which can append its own parameters), you can add custom code to your theme's functions.php file to exclude specific URLs from protection. The code snippet found in the support threads can serve as a starting point, but it requires customization and coding knowledge.

3. Pass the Password via URL (A Limited Alternative)

Some users have found a partial workaround by passing the password directly in the URL using the following format:

https://yourdomain.com/?password_protected_pwd=YOURPASSWORD

Important Note: This method may not work for a user's first visit and is generally considered a less secure practice, as the password is exposed in the browser's address bar and history.

Important Considerations

  • SEO Impact: As noted in the support threads, these long URLs are not SEO-friendly. However, since the content behind them is password-protected and not intended for search engines to index, the direct SEO impact may be minimal. The primary concern is often aesthetics and user experience.
  • Caching Conflicts: Several issues related to URLs and login behavior can be caused by caching plugins or server-level caching (like Cloudflare). If you are experiencing inconsistent behavior, always clear all your caches as a first step.

While the long login URL is a known characteristic of the plugin, the developer and community have proposed several methods to manage its impact. For most users, waiting for the official filter hook or employing a custom exclusion script are the most viable paths forward.

Related Support Threads Support