EffortLess Smart Page Redirects

Description

EffortLess Smart Page Redirects lets you send visitors of a specific WordPress page to another URL. Each redirect is stored as its own “Redirect Rule”, so you can add, edit, disable (by moving the rule to draft) or delete redirects without touching theme files or the .htaccess file.

Two redirect modes are available per rule:

  • Immediate redirect (default). The page never renders; WordPress sends a 301 Moved Permanently response to the destination URL.
  • Delayed redirect (“Analytics-Safe Redirect”). The page starts loading, a full-screen overlay with a loading spinner is shown, and the browser is sent to the destination after a delay you choose (0.5 to 10 seconds). Because the page is actually loaded, analytics scripts that run on it — such as Matomo, Google Analytics 4 or Google Tag Manager — have time to fire and record the pageview before the visitor leaves.

The delayed mode can use either a <meta http-equiv="refresh"> tag or a JavaScript setTimeout() call, selectable per rule.

What each setting does

Every Redirect Rule has the following fields:

  • Page to Redirect — the published page whose visitors will be redirected. The dropdown lists your pages with their IDs.
  • Destination URL — the full target URL, including the https:// scheme. It may point to another page on your site or to an external address.
  • Network Wide (multisite only) — when checked, the rule is also evaluated on the other sites of the network. On another site it applies to the content with the same numeric ID as the selected page, and if no content there has that ID, to the content with the same slug (see “How a rule is matched” below).
  • Analytics-Safe Redirect — unchecked means an immediate 301; checked switches the rule to the delayed mode and reveals the two settings below.
  • Delay MethodMeta Refresh (works without JavaScript) or JavaScript.
  • Delay (seconds) — how long to wait before leaving the page, between 0.5 and 10 seconds. Between 1.5 and 3 seconds is usually enough for a tracking script to send its request.

How a rule is matched

When a visitor opens a page, the plugin looks for an applicable rule in two passes:

  1. By page ID. A rule applies if the content being viewed has the ID selected in the rule.
  2. By page slug. Only if no rule matched by ID, a rule applies if the content being viewed has the same slug as the page selected in that rule.

The ID pass always wins, so on a single site nothing changes. The slug pass matters on multisite, where a network-wide rule created on one site can now also apply on sites where the corresponding page has a different ID but the same slug. It also keeps a rule working if its target page was deleted and recreated under the same slug.

Notes and limitations

  • A rule only takes effect once it is published. Rules kept as drafts are ignored, which is a convenient way to switch a redirect off temporarily.
  • Only one rule is applied per page; if several published rules point at the same page, the first one found is used.
  • On multisite, a network-wide rule is matched by ID before it is matched by slug. If a site has unrelated content at the same numeric ID as the rule’s target page, that content is what gets redirected on that site.
  • Rules are cached for one hour per site to avoid a database query on every page view. The cache is refreshed when a rule is saved, trashed, restored or deleted, and when the slug of any content changes — on multisite this applies to every site of the network, so a network-wide rule takes effect everywhere immediately.
  • Redirects are not applied in the admin area or in the block/theme editor preview.
  • The plugin adds no tracking of its own and sends no data anywhere.

Donate

If this plugin is useful to you and you would like to support its maintenance, donations are welcome at https://id7.dev/donate/ , including in Bitcoin (BTC): bc1q8a9a5khvfyxlptfyyrpn2x44a4hq40qxql6tx4

Installation

  1. In your WordPress admin, go to Plugins Add New Upload Plugin and upload the plugin zip file, or copy the effortless-smart-page-redirects folder into /wp-content/plugins/.
  2. Activate the plugin through the Plugins menu.
  3. A Redirect Rules menu appears in the admin sidebar. Go to Redirect Rules Add New.
  4. Give the rule a title for your own reference (for example “Old pricing page”).
  5. In the Redirect Settings box, choose the Page to Redirect and type the Destination URL.
  6. Leave Analytics-Safe Redirect unchecked for a standard 301 redirect, or check it and set the delay method and delay if you want your analytics to record the visit first.
  7. Click Publish. The redirect is active immediately.

To disable a redirect later, edit the rule and switch it back to draft, or move it to the trash.

FAQ

What is the difference between the two redirect modes?

The immediate mode sends a 301 Moved Permanently header before anything is rendered, which is what search engines expect for a permanent move. The delayed mode loads the page first, shows a spinner overlay, and then moves the visitor to the destination. Use the delayed mode when you need scripts on the page — analytics in particular — to run before the visitor leaves.

Which analytics tools does the delayed mode work with?

It is not tied to a specific tool. The plugin simply keeps the visitor on the page for the delay you configure, so any script that is already loaded on that page, including Matomo, Google Analytics 4 and Google Tag Manager, has that time to send its request. Whether a given pageview is recorded depends on how quickly that script loads on your site; increase the delay if visits are missing.

Does it support 301 redirects?

Yes. Rules with Analytics-Safe Redirect unchecked are sent as 301 Moved Permanently via wp_safe_redirect(). The delayed mode is a client-side redirect and does not send a 301 status.

Can I redirect to an external site?

Yes. Enter the full URL in the Destination URL field.

Does it work on multisite?

Yes. Rules are created per site, and checking Network Wide makes a rule apply on the other sites of the network as well. On those sites the rule matches content with the same numeric ID as the target page, or, when no content has that ID, content with the same slug.

Will it slow down my site?

The list of published rules is read once and cached for an hour per site, and the check runs only on single pages and posts on the front end. Pages without a matching rule are left untouched.

I created a rule but nothing happens

Check that the rule is published rather than saved as a draft, that both the page and the destination URL are filled in (the rule is not saved if either is empty), and that you are testing on the front end while not previewing the page from the editor.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“EffortLess Smart Page Redirects” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.6.8

  • Added: A rule is now also matched on the target page slug when no content matches its page ID, so a network-wide rule works across sites whose page IDs differ
  • Fixed: Network-wide rules coming from another site of the network were read against the current site’s tables, so their destination URL and options could be missing or wrong
  • Fixed: The cached rule list is now refreshed when a rule is trashed, restored or deleted, when a slug changes, and across every site of a network instead of only the site where the rule was saved

1.6.7

  • Improved: Rewritten readme with a factual description of the plugin, a description of every setting, and clearer configuration steps
  • Improved: Plugin header description reworded without marketing claims

1.6.6

  • Fixed: Text Domain now matches the plugin slug (effortless-smart-page-redirects, was singular effortless-smart-page-redirect)

1.6.5

  • Fixed: Plugin identifiers now use the elspr_ / ELSPR_ prefix (was espr_), with a one-time automatic migration of existing redirect rules
  • Fixed: Version number mismatch between plugin header and code
  • Fixed: Inline <script>/<style> tags replaced with properly enqueued assets
  • Added: Donate link plugin header and standardized donate notice
  • Improved: Tested up to WordPress 7.0

1.6.3

  • Fixed: Remaining PHPCS warning on the network-wide rules query
  • Improved: Spinner font stack

1.6.2

  • Added: Object caching of redirect rules
  • Fixed: Sanitization of the destination URL
  • Fixed: Script enqueuing with version and footer loading
  • Improved: Early exit when the current page has no rule

1.6.1

  • Fixed: Typo in save_meta() that prevented rules from being stored
  • Improved: Escaping and sanitization
  • Changed: The JavaScript redirect now uses wp_add_inline_script()

1.6.0

  • Initial release