| 开发者 | itsrakibroni |
|---|---|
| 更新时间 | 2026年10月12日 20:47 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
/, /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/"action="/contact/" are fixed too.href), form actions (action), images and scripts (src) and responsive images (srcset)./shop/ on the same domain, untouched.wp subfolder-links status and wp subfolder-links test / /about-us/.example.com/kit-one/, example.com/kit-two/./ links.//cdn.example.com/...) and full URLs.data-* attributes.vantorix_slf_attributes — array of attributes to rewrite.vantorix_slf_excluded_paths — array of path prefixes to skip.vantorix_slf_should_run — return false to skip the current request.vantorix_slf_purge_caches — action fired after settings change; purge your own cache here.add_filter( 'vantorix_slf_should_run', function ( $run ) { return is_page( 'landing' ) ? false : $run; } );
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.
No. When there is no subfolder in your Home URL the plugin does nothing.
Add their path to Excluded paths under Advanced, one per line, e.g. /shop/. Links starting with that path are left alone.
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.
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.
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.
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/.
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.
Yes, on subdirectory networks. Each subsite uses its own folder from its own Home URL. It can be network-activated.
wp subfolder-links status and wp subfolder-links test.