跳到内容

PathGuard Redirects

v1.1.0

MD. Samrat Hossen · 2026年5月22日 上架

Block specific relative URLs on your site and redirect visitors to a custom destination or your theme's 404 page.

正在使用
10 以下
评分
暂无
累计下载
405
最近更新
2026年9月27日
需要 WordPress 5.8+已测试到 7.1.5PHP 7.4+

PathGuard Redirects is a lightweight, developer-friendly plugin that lets site administrators block any relative URL on their WordPress site and control exactly what happens when a visitor tries to access it.

How it works

Add the relative paths you want to block (one per line) and choose what should happen when someone visits them:

  • Custom URL redirect — send visitors to any destination URL with a 302 redirect.
  • 404 Not Found — serve your theme’s native 404 page with a proper HTTP 404 status header (no redirect, the URL stays the same).

Key features

  • Block any number of relative paths (e.g. /secret-page/, /members-only/).
  • Choose the redirect action per-site: custom URL or 404 page.
  • Exclude Admins — logged-in administrators are bypassed by default so they always have access. The option can be unchecked to restrict admins too.
  • One-click access via the Settings link on the Plugins list page.
  • Settings are kept when the plugin is deactivated and removed from the database when it is deleted.
  • Paths are matched with or without a trailing slash and regardless of case — /secret-page, /secret-page/ and /Secret-Page/ all match.
  • URL-encoded paths are decoded before matching, preventing bypass attempts like /%73ecret-page/. Non-ASCII paths (e.g. /café/) are supported.
  • Full URLs pasted into the list are converted to paths on save.
  • Page caches are purged when the rules change (WP Super Cache, WP Rocket, W3 Total Cache, LiteSpeed Cache; other caches can use the pathguard_redirects_rules_updated action).

Security

  • CSRF protection on every save using WordPress nonces.
  • Strict capability check (manage_options) before processing any form data.
  • All input is sanitised (sanitize_text_field, esc_url_raw, sanitize_key).
  • All output is escaped (esc_textarea, esc_attr, esc_html_e).
  • The redirect destination can only be set by administrators; visitors cannot influence where they are sent.

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums