{"record":{"id":"e147b2a367100059","repo":"wpscanteam/wpscan","slug":"unable-to-identify-the-wp-content-dir-please-supp","errorCode":null,"errorMessage":"Unable to identify the wp-content dir, please supply it with --wp-content-dir, use the --scope option or make sure the --url value given is the correct one","messagePattern":"Unable to identify the wp-content dir, please supply it with --wp-content-dir, use the --scope option or make sure the --url value given is the correct one","errorType":"exception","errorClass":"WPScan::Error::WpContentDirNotDetected","httpStatus":null,"severity":"error","filePath":"app/controllers/custom_directories.rb","lineNumber":21,"sourceCode":"module WPScan\n  module Controller\n    # Controller to ensure that the wp-content and wp-plugins\n    # directories are found\n    class CustomDirectories < WPScan::Controller::Base\n      def cli_options\n        [\n          OptString.new(['--wp-content-dir DIR',\n                         'The wp-content directory if custom or not detected, such as \"wp-content\"']),\n          OptString.new(['--wp-plugins-dir DIR',\n                         'The plugins directory if custom or not detected, such as \"wp-content/plugins\"'])\n        ]\n      end\n\n      def before_scan\n        target.content_dir = ParsedCli.wp_content_dir if ParsedCli.wp_content_dir\n        target.plugins_dir = ParsedCli.wp_plugins_dir if ParsedCli.wp_plugins_dir\n\n        raise Error::WpContentDirNotDetected unless target.content_dir\n      end\n    end\n  end\nend\n","sourceCodeStart":3,"sourceCodeEnd":26,"githubUrl":"https://github.com/wpscanteam/wpscan/blob/62c9cef471de90095f6b42245a11d0f8172d19c9/app/controllers/custom_directories.rb#L3-L26","documentation":"Raised by Controller::CustomDirectories#before_scan (app/controllers/custom_directories.rb:21) when target.content_dir is still nil: neither --wp-content-dir was supplied nor could WPScan infer the wp-content directory from the site. All subsequent plugin/theme logic depends on that path, so the scan stops in this controller before enumeration starts.","triggerScenarios":"`wpscan --url http://target` (no --wp-content-dir) where homepage analysis finds no wp-content references and default detection fails: renamed content directory (e.g. /content, /assets), JS-bundled themes with custom asset paths, a homepage that references nothing WP-specific, or a --url pointing at a static front page instead of the install root.","commonSituations":"Renaming/obfuscation plugins (Hide My WP, WP Hide) relocating wp-content; headless/SPA frontends; --url pointing at a landing page while WordPress lives under a subpath; cached/minified HTML stripped of original asset URLs.","solutions":["Find the real directory (view page source, inspect asset URLs) and pass it: --wp-content-dir content","Make sure --url points at the WordPress install root, not a static page in front of it","Widen --scope so more of the domain's URIs are usable for detection","If plugins are also served from a custom path, add --wp-plugins-dir as well"],"exampleFix":"# before\nwpscan --url https://target\n# => Unable to identify the wp-content dir ...\n\n# after (renamed dir discovered from the page source)\nwpscan --url https://target --wp-content-dir assets/content","handlingStrategy":"validation","validationCode":"# Infer the content dir from the homepage before scanning\nbody = Typhoeus.get(url).body\nm = body.match(%r{(?:https?://[^/]+)?/([\\w-]+)/(?:plugins|themes)/})\nARGV.push('--wp-content-dir', m[1]) if m","typeGuard":null,"tryCatchPattern":"begin\n  scan.run\nrescue WPScan::Error::WpContentDirNotDetected\n  retry with '--wp-content-dir <dir>' obtained from the page source\nend","preventionTips":["Check the page source for asset paths before scanning customized sites","Always supply --wp-content-dir for sites known to rename content dirs","Scan the install root URL, not proxy or landing pages","Remember --wp-plugins-dir when plugins are served from a custom path"],"tags":["wp-content-dir","directory-detection","custom-paths","obfuscation"],"backgroundTag":"content-path-detection-failed","analyzedSha":"62c9cef471de90095f6b42245a11d0f8172d19c9","analyzedAt":"2026-08-21T17:10:47.902Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}