How to Hide Your WordPress Theme and Plugins from Detectors
Updated 23 Oct 2026 路 by the DetectWP team
If you have run your own site through a detector and been surprised by how much it reveals, the natural next question is how to switch that off. The honest answer has two parts. You can remove most of the obvious fingerprints with a handful of configuration changes, and this guide shows exactly how. But hiding your stack from tools like DetectWP does almost nothing to stop real attacks, because automated attackers do not check what you are running before they try an exploit. We cover the hiding techniques first, then the security measures that genuinely matter, so you can decide where to spend your effort.
What detectors actually look at
Detection relies on a short list of public signals. Knowing them tells you what you would need to change:
- Asset URLs containing
/wp-content/themes/<slug>/and/wp-content/plugins/<slug>/. - The
<meta name='generator' content='WordPress x.y'>tag, and the matching<generator>element in RSS feeds. ?ver=query strings on scripts and styles, which usually expose core, theme and plugin versions.- The REST API discovery link
<link rel='https://api.w.org/' href='.../wp-json/'>, theLink:response header that duplicates it, and the public/wp-json/index listing plugin namespaces. - HTML comments written by SEO and caching plugins.
- Readable files such as
readme.html,license.txt,style.cssheaders and pluginreadme.txtfiles. - CSS class prefixes, script handles and JavaScript globals that are characteristic of a theme or plugin.
The first six items can be removed or blocked. The last one cannot be removed without rewriting the theme and plugins themselves, and it is the one experienced reviewers and good detectors fall back on. Keep that in mind as you read the techniques below: each one raises the effort required to identify your stack, but none of them makes it impossible.
Technique 1: Rename the wp-content directory
WordPress lets you move or rename the content directory by defining two constants in wp-config.php before the line that loads wp-settings.php:
define('WP_CONTENT_DIR', dirname(__FILE__) . '/assets'); and define('WP_CONTENT_URL', 'https://example.com/assets');
After renaming the folder on disk to match, well-written themes and plugins keep working because they use plugins_url(), get_template_directory_uri() and similar functions rather than hard-coded paths. Poorly written ones break, and you will only find out by testing every feature. The subfolders themes, plugins and uploads keep their names, so anyone who searches the source for /themes/ instead of /wp-content/themes/ still finds the slugs. Plugins such as WP Hide & Security Enhancer and Hide My WP Ghost automate this and go further by rewriting paths at the server level, at the cost of extra complexity and another plugin to keep updated.
Renaming a theme or plugin folder itself is riskier: WordPress identifies plugins by their folder and file name, so a renamed plugin will no longer receive updates from wordpress.org, which is a security regression rather than an improvement.
Technique 2: Remove the generator tag and version strings
These are the easiest fingerprints to remove and the least likely to break anything. Add the following to a child theme's functions.php or a small custom plugin.
To remove the generator tag from the page head and from feeds: remove_action('wp_head', 'wp_generator'); followed by add_filter('the_generator', '__return_empty_string');. The filter is what cleans the RSS and Atom feeds, which many people forget.
To strip ?ver= from enqueued assets, filter both loaders: add_filter('style_loader_src', 'remove_ver_query', 9999); and add_filter('script_loader_src', 'remove_ver_query', 9999);, where the callback returns remove_query_arg('ver', $src). Be aware of the trade-off: the version string is how WordPress busts browser and CDN caches when a file changes. Without it, visitors may keep using an old stylesheet after an update until their cache expires. Some caching plugins offer the same option with a cache-busting replacement built in, which is a better route if you already use one.
Also block direct access to readme.html and license.txt in the site root with a server rule, or delete them after each core update. They reveal the exact WordPress version and nothing on the site depends on them.
Technique 3: Hide REST API discovery (without breaking the editor)
The block editor, many plugins and the mobile apps all depend on the REST API, so do not disable it outright. What you can safely remove is the public advertising of it. In functions.php: remove_action('wp_head', 'rest_output_link_wp_head'); removes the <link rel='https://api.w.org/'> tag, remove_action('template_redirect', 'rest_output_link_header', 11); removes the matching Link: response header, and remove_action('wp_head', 'wp_oembed_add_discovery_links'); removes the oEmbed links that also point at /wp-json/.
If you want the index itself to stop listing plugin namespaces to anonymous visitors, you can require authentication for the whole API with the rest_authentication_errors filter, returning a WP_Error when is_user_logged_in() is false. Test carefully afterwards: contact forms, block-based themes, WooCommerce Store API checkout and any JavaScript-driven feature may rely on anonymous REST requests. The WordPress developer handbook has a REST API FAQ that describes the trade-offs.
Remember that /wp-json/ is just a pretty URL; /?rest_route=/ reaches the same endpoint, so a server rule that blocks only the path is incomplete.
Technique 4: Combine assets and strip plugin comments
Optimisation plugins such as Autoptimize, WP Rocket, LiteSpeed Cache and Perfmatters can merge dozens of plugin stylesheets into one file served from a cache directory, remove the ?ver= parameters and delete HTML comments. Site owners usually enable these features for speed, but the side effect is that most /wp-content/plugins/ paths vanish from the HTML. SEO plugins such as Yoast and Rank Math also provide filters or settings to remove their signature comments.
This is the technique with the best ratio of benefit to risk, because combining and minifying assets is worth doing anyway. It does not, however, touch class names like wpcf7-form, woocommerce or elementor-element, nor inline JavaScript settings objects, nor behaviour such as the way a form submits. A detector that reads those signals, including DetectWP, will still identify the major plugins. See how plugins are detected for the full list of what survives.
Why this is mostly security through obscurity
The usual argument for hiding your stack is that attackers scan for sites running a vulnerable plugin and then exploit it. That is true, but the scanning rarely works the way people imagine. Mass exploitation tools do not read your HTML, identify Contact Form 7 version 5.x and then look up an exploit. They fire the exploit request at every domain on a list, whether or not the plugin is installed, because sending the request is cheaper than checking. A hidden plugin path does not stop a request to the plugin's vulnerable endpoint, which is at a URL the attacker already knows.
Hiding also provides no protection against the attacks that compromise most WordPress sites: credential stuffing against wp-login.php and XML-RPC, exploitation of plugins that have not been updated, and malicious or nulled themes and plugins installed by the site owner. None of those depends on the attacker knowing your theme name.
There are legitimate reasons to tidy up fingerprints. Removing the generator tag and unused discovery links is harmless housekeeping, and combining assets improves performance. Just treat the result as a reduction in noise, not as a security control, and do not let it displace the measures in the next section.
What actually improves security
If you have an hour to spend on security, spend it here rather than on hiding:
- Keep everything updated. Core minor releases update automatically by default; enable automatic updates for plugins and themes too, or at least check weekly. Almost every exploited vulnerability had a patch available. Our vulnerability guide explains how to check your installed versions.
- Remove what you do not use. Inactive plugins and themes are still code on the server and some vulnerabilities can be reached even when a plugin is inactive. Delete them.
- Harden logins. Strong unique passwords, two-factor authentication for every administrator, a limit on failed login attempts, and disabling XML-RPC if nothing uses it.
- Use a web application firewall. A WAF, whether from your host, a CDN such as Cloudflare, or a plugin such as Wordfence or Patchstack, blocks known exploit patterns before they reach PHP and can virtually patch a vulnerability before you have time to update.
- Lock down the file system. Add
define('DISALLOW_FILE_EDIT', true);towp-config.php, set sensible file permissions and keep PHP on a supported version. - Back up and monitor. Automated off-site backups and a file-integrity or malware scanner turn a compromise from a disaster into an inconvenience.
Do those six things and it genuinely will not matter whether a detector can read your theme name. The DetectWP methodology page explains how we use the same public signals responsibly, including why we surface known vulnerabilities to help owners fix them rather than to help anyone exploit them.
Frequently asked questions
Can I completely hide that my site runs WordPress?
Not reliably. You can remove the obvious markers, but login URLs, REST behaviour, block markup, plugin CSS prefixes and JavaScript globals still identify WordPress to anyone who looks carefully. Aim to reduce noise, not to achieve invisibility.
Does hiding the WordPress version stop attacks?
No. Automated attacks target plugin vulnerabilities by sending exploit requests to every site regardless of version. Keeping core, themes and plugins updated is what stops them.
Will removing ?ver= from scripts break my site?
It will not break pages, but it removes cache busting. After you update a theme or plugin, visitors and CDNs may keep serving the old CSS or JavaScript until their caches expire. Use a plugin that replaces the version with a hash if you want both.
Is it safe to disable the REST API?
Disabling it entirely breaks the block editor, the mobile apps and many plugins. It is safer to remove the discovery links and, if necessary, require authentication for anonymous requests, then test every front-end feature.
Do hiding plugins like Hide My WP Ghost work?
They remove or rewrite most path-based fingerprints and can make a site harder to identify at a glance. They add complexity, can conflict with caching and other plugins, and do not change class names or behaviour, so they are a tidy-up rather than a security boundary.
Related
Free tools: WordPress plugin detector 路 WordPress theme detector 路 WordPress hosting detector