Onlinefotka 404 to 301 Redirect

Description

Onlinefotka 404 to 301 Redirect gives you complete control over how your WordPress site handles broken URLs — without touching any code.

Catch every 404, redirect it intelligently, keep a detailed log, get notified by email, and manage unlimited custom rules. Built for both standard WordPress sites and WooCommerce stores.

Redirect Engine

  • Choose between 301, 302, 307, and 308 HTTP redirect codes
  • Set a global fallback target for all unmatched 404s
  • Add unlimited custom redirect rules with exact match, wildcard (* / **), regex, or prefix matching
  • Drag-and-drop rule priority — the first matching rule wins
  • Ignore query strings when matching (configurable)
  • Exclude specific paths from being redirected or logged
  • Bot detection — skip logging and redirecting known crawlers

Custom Redirect Rules

  • Add, edit, and delete rules directly in the admin
  • Four match types: Exact, Wildcard, Regex, Prefix
  • Per-rule HTTP code (301 / 302 / 307 / 308)
  • Enable or disable individual rules without deleting them
  • Import rules from CSV (columns: source, destination, match_type, http_code)
  • Export all rules to CSV for backup or migration

Error Log

  • Detailed log of every 404 event: URL, referrer, IP, user agent, date/time, hit count
  • Same-day duplicate hits are counted (not duplicated) to keep the log clean
  • Search and filter by URL or referrer
  • Bulk delete or clear all logs with one click
  • Export logs to CSV
  • Quick-action button: create a redirect rule directly from any log entry
  • Automatic log cleanup — configurable retention period (default: 90 days, runs via daily WP cron)

Statistics Dashboard

  • At-a-glance stat cards: total hits, today, last 7 days, active redirect rules
  • Bar chart of 404 errors for the last 30 days (Chart.js)
  • Top 10 most-missed URLs with one-click redirect creation
  • Top referrers sending traffic to 404 pages
  • WordPress admin dashboard widget with key stats

Email Notifications

  • Optional per-event email alerts for 404 errors
  • Configurable recipient email address
  • Hit threshold — only notify after a URL has hit X errors today
  • Cooldown — prevent notification spam (configurable minutes between alerts)
  • Digest mode — receive a daily or weekly summary email instead of per-event alerts
  • Branded HTML email template (auto-detects site name and URL)

WooCommerce Integration

  • Auto-redirect deleted or trashed WooCommerce products to their category (or the shop page)
  • Skip WooCommerce AJAX and REST API 404s to avoid interfering with blocks and cart
  • HPOS (High Performance Order Storage) compatible
  • WooCommerce Blocks compatible

Translations

The plugin interface is available in the following languages:

  • English (built-in)
  • Slovak (sk_SK)
  • German (de_DE / Deutsch)
  • Czech (cs_CZ / Čeština)

The .pot template is included in the languages/ folder. Contributions via translate.wordpress.org are welcome.

Requirements

  • WordPress 6.0 or higher
  • PHP 7.4 or higher
  • WooCommerce 7.0 or higher (optional — WooCommerce features only)

External Services

This plugin optionally connects to Google Search Console to help you find URLs that return 404 errors on your site. This feature is entirely optional and must be manually set up by the site administrator. No data is sent to any external service until the administrator explicitly connects their Google account.

Google OAuth 2.0

When you connect to Google Search Console, the plugin authenticates using Google’s OAuth 2.0 service.

  • Service: Google OAuth 2.0 (https://accounts.google.com, https://oauth2.googleapis.com)
  • What is sent: OAuth authorization code and refresh token during the authentication handshake. Your Google client ID and client secret (entered by you in plugin settings) are used to request an access token.
  • When: Only when the administrator clicks “Connect to Google” and completes the OAuth flow, and subsequently when the access token is automatically refreshed.
  • Google Terms of Service: https://policies.google.com/terms
  • Google Privacy Policy: https://policies.google.com/privacy

Google Search Console API

After connecting, the plugin can query the Google Search Console Search Analytics API to retrieve URLs from your verified property.

  • Service: Google Search Console API (https://searchconsole.googleapis.com)
  • What is sent: Your verified site URL and a date range (up to 480 days back), along with the OAuth access token for authorization. No personally identifiable visitor data is sent.
  • When: Only when the administrator manually clicks “Fetch from GSC” on the Google Search Console settings page.
  • Google API Terms of Service: https://developers.google.com/terms
  • Google Privacy Policy: https://policies.google.com/privacy

Installation

  1. Upload the plugin folder to /wp-content/plugins/ or install via Plugins Add New
  2. Activate the plugin through the Plugins screen in WordPress
  3. Navigate to Tools 404 to 301 to see the dashboard
  4. Go to Tools 404 to 301 Settings to configure redirect behaviour

FAQ

Does the plugin work without WooCommerce?

Yes. All core features (redirect, logging, email, custom rules) work on any WordPress site. WooCommerce-specific features (auto product redirect, skip AJAX/REST) are only shown and active when WooCommerce is installed.

What is the difference between 301 and 302?

A 301 tells search engines the page has permanently moved — pass SEO authority to the new URL. A 302/307 is temporary — search engines keep indexing the old URL. Use 301 for pages that are gone for good.

Does wildcard matching support query strings?

Only if you disable “Ignore Query Strings” in Settings. By default the plugin strips query strings before matching, so /page/?foo=bar matches the rule /page/.

What does regex matching look like?

Use a regex without delimiters: ^/old-blog/(.+)$. The plugin wraps it in #…#i delimiters automatically. You can reference capture groups in the destination using $1, $2, etc.

Will old log entries be deleted automatically?

Yes. A daily WP Cron job deletes entries older than the configured retention period (default 90 days). You can change the period in Settings or set it to 0 to keep logs indefinitely.

Does this plugin delete my data when uninstalled?

No, by default. Enable “Delete all data on uninstall” in Settings Data & Uninstall if you want a clean removal.

Can I import redirects from another plugin?

Yes — export a CSV from your old plugin with columns source, destination, match_type, http_code and use the Import CSV function on the Redirect Rules page.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“Onlinefotka 404 to 301 Redirect” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.0.1

  • Fixed regex back-reference substitution in redirect rules
  • Fixed cron duplication on plugin reactivation
  • Fixed dead destination check cron missing on existing installs
  • Fixed CSV export date using server timezone instead of WordPress timezone
  • Added destination health check feature (weekly auto-check + manual button)

1.0.0

  • Initial release
  • 301 / 302 / 307 / 308 redirect support
  • Global fallback redirect target
  • Custom redirect rules: exact, wildcard, regex, prefix match types
  • Drag-and-drop rule priority
  • Detailed 404 error log with hit count deduplication
  • Log search, bulk delete, clear all, CSV export
  • Auto log cleanup via daily WP Cron (configurable retention)
  • Statistics dashboard: stat cards, 30-day bar chart, top 10 URLs, top referrers
  • Admin dashboard widget
  • Email notifications with threshold, cooldown and digest modes
  • Branded HTML email template
  • WooCommerce: auto-redirect deleted products to category / shop
  • WooCommerce: skip AJAX and REST API 404s
  • HPOS and WooCommerce Blocks compatible
  • Import redirect rules from CSV
  • Export redirect rules and logs to CSV
  • Quick “Add Redirect” action from log rows
  • Bot detection (skip logging crawlers)
  • Exclude paths from redirect/logging (fnmatch wildcards)
  • Translations: English (built-in), Slovak (sk_SK), German (de_DE), Czech (cs_CZ)
  • PHP 7.4+, WordPress 6.0+