Vantorix – Subfolder Link Fixer

Vantorix – Subfolder Link Fixer

Details
View on WordPress

Links such as /, /about-us/ or /contact/ are handy because they work on any domain. But when WordPress lives in a subfolder — for example https://example.com/demo/ — those links jump to the domain root and visitors land on the wrong page or a 404.

Subfolder Link Fixer detects your site’s subfolder from the Home URL and quietly fixes those links in the page sent to the browser:

  • href="/" becomes href="/demo/"
  • href="/about-us/" becomes href="/demo/about-us/"
  • Form actions like action="/contact/" are fixed too.

A live link tester on the settings screen shows exactly what visitors will get for any link you type.

Nothing is written to your database. Your posts, menus and page-builder data stay exactly as they were, so you can move the site back to a root domain, export it, or switch the plugin off at any time.

Good for

  • Theme and template-kit demo sites hosted side by side, e.g. example.com/kit-one/, example.com/kit-two/.
  • Staging copies that live in a subfolder of the live domain.
  • Subdirectory Multisite networks — every subsite gets its own folder automatically.
  • Imported content or page-builder layouts that contain hard-coded / links.

What it leaves alone

  • Protocol-relative links (//cdn.example.com/...) and full URLs.
  • Links that already include the subfolder.
  • data-* attributes.
  • Admin screens, AJAX, REST API, feeds and the Elementor editor preview.
  • Sites installed at the domain root — the plugin simply stays idle.

For developers

  • vantorix_slf_attributes — array of attributes to rewrite. Default: href, action.
  • vantorix_slf_should_run — return false to skip the current request.

Example: also rewrite src attributes.

add_filter( 'vantorix_slf_attributes', function ( $attributes ) {
    $attributes[] = 'src';
    return $attributes;
} );

Details

Plugin code:
vantorix-subfolder-link-fixer
Plugin version:
1.0.0
Author:
Outdated:
No
WP version:
5.8 or higher
PHP version:
7.4 or higher
Test up to WP version:
7.1.3
Total installations:
0
Last updated:
2026-10-12
Rating:
Times rated:
0
multisite
relative-links
staging
subdirectory
subfolder