WP Ghost can hide wp-admin and wp-login.php references from your site’s HTML source code. After changing these paths with WP Ghost, the original URLs should no longer appear in the frontend source. If they still show up, it’s usually because a theme or plugin is outputting the paths directly instead of using WordPress functions. This guide covers how to hide the paths, verify they’re hidden, and fix cases where they still appear.
WordPress and many plugins output wp-admin and wp-login.php URLs in the frontend HTML source: in admin bar links, login/logout links, comment form URLs, and various plugin-generated markup. Bots scan this source code to discover admin and login paths. WP Ghost replaces these paths in the HTML output, but plugins that hardcode paths (instead of using WordPress functions like admin_url()) can bypass WP Ghost’s replacement.
First, make sure you’ve changed and hidden both admin paths in WP Ghost:
Both paths need to be changed (renamed to custom URLs) and hidden (original paths return 404 or a custom page) for maximum protection.
After hiding the paths, run a security check to confirm they no longer appear in the source code:
You can also verify manually: open your site in an incognito browser window (logged out), view the page source (Ctrl+U), and search for wp-admin and wp-login. If either term appears, something is still outputting the original paths.
If wp-admin or wp-login.php still appear in the source code after enabling WP Ghost’s hide options, a theme or plugin is hardcoding the paths instead of using WordPress functions.
To identify the source:
Once you identify the plugin or theme, contact the developer and ask them to use WordPress functions instead of hardcoded paths:
admin_url('/') instead of hardcoding /wp-admin/wp_login_url() instead of hardcoding /wp-login.phpWhen plugins and themes use these WordPress functions, WP Ghost can intercept and replace the paths with your custom URLs automatically.
Text Mapping as a workaround. If the plugin developer can’t fix the hardcoded paths, you can use WP Ghost’s Text and URL Mapping feature to find and replace the remaining wp-admin or wp-login.php references in the HTML output.
By default, WP Ghost hides paths in the frontend for all visitors, including logged-out users and bots. Logged-in admin users may still see original paths in the WordPress admin bar. To extend path changes to the admin dashboard, see Change Paths in Admin Dashboard.
The correct function is wp_login_url(). This returns the login URL and respects custom login paths set by security plugins like WP Ghost. Some older documentation references home_url('wp-login.php'), but wp_login_url() is the proper WordPress function because it supports filters.
No. WP Ghost replaces paths in the HTML output buffer using WordPress hooks. No core files are modified. The paths are changed dynamically at render time.
Admin and login path security:
Replace the default wp_ database prefix with a random one to protect against SQL injection…
Change the WordPress uploads directory path with WP Ghost (rewrite rules, no files moved) or…
Configure WP Ghost with WP Rocket cache. Enable file optimization, Change Paths in Cache Files.…
https://youtu.be/6ylhojSi-_E In this video, we’ll explore why website security matters and what can happen if…
The security of your WordPress site depends on multiple factors, such as the strength of…
Step-by-step guides to connect WP Ghost 2FA with Google Authenticator, Authy, Microsoft Authenticator, or LastPass.…