Linux 软件免费装
Banner图

Vantorix - Subfolder Link Fixer

开发者 itsrakibroni
更新时间 2026年10月12日 20:47
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

multisite staging subdirectory subfolder relative links

下载

1.0.0 1.1.0

详情介绍:

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: Nothing is written to your content. 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. Features Good for What it leaves alone For developers Example: skip rewriting on one page. add_filter( 'vantorix_slf_should_run', function ( $run ) { return is_page( 'landing' ) ? false : $run; } );

安装:

  1. Go to Plugins → Add New, search for "Subfolder Link Fixer", then install and activate. Or upload the zip from Plugins → Add New → Upload Plugin.
  2. Open Settings → Subfolder Link Fixer, check the detected subfolder and try a link in the tester.
  3. Done. If your cache plugin is one of the supported ones, it is cleared for you when you save.

屏幕截图:

  • Before and after: a "/" link on a subfolder site sends visitors to the domain root; with the plugin it stays inside the site.

升级注意事项:

1.1.0 Adds src/srcset support, excluded paths, automatic cache clearing, Site Health info and WP-CLI commands. Existing settings are kept.

常见问题:

Does it change my database or page-builder data?

No. Links are rewritten only in the HTML sent to visitors. The plugin stores only its own settings. Deactivate it and everything is exactly as before.

My site is at the domain root. Do I need this?

No. When there is no subfolder in your Home URL the plugin does nothing.

Some links should go to the domain root on purpose.

Add their path to Excluded paths under Advanced, one per line, e.g. /shop/. Links starting with that path are left alone.

Should I enable src and srcset?

Only if your content has images or scripts with paths like /wp-content/... that break in the subfolder. Links and form actions are enabled by default.

Does it work with Elementor and other page builders?

Yes. It works on the final HTML, so it does not matter which builder or theme produced the link. The Elementor editor preview is skipped so editing is not affected.

Does it work with caching plugins?

Yes. Pages are cached after the links are fixed. LiteSpeed Cache, WP Rocket, W3 Total Cache, WP Super Cache and SiteGround Optimizer are cleared automatically when you change settings. For other caches, clear them once yourself.

How can I check it is working?

Use the tester on the settings screen, turn on the debug comment and view the page source, or run wp subfolder-links test /about-us/.

Will it slow down my site?

The work is a single pattern replacement on the page output, which is very fast. With a page cache it runs only when a page is generated.

Does it work on Multisite?

Yes, on subdirectory networks. Each subsite uses its own folder from its own Home URL. It can be network-activated.

更新日志:

1.1.0 1.0.0