Unknown URLs in Google Search Console can be harmless parameter variations, outdated links, automated bot requests or evidence of a compromised website. Inspect several examples, check the actual HTTP responses and page content, and review Security issues before blocking anything. Do not assume that every strange URL is a hack.
A sudden flood of URLs containing random letters, product names, or unfamiliar paths can look alarming. The safe response is investigation, not a blanket robots.txt rule. Different URL patterns require different remedies.
First separate ordinary parameters from suspicious URLs
| URL pattern | Possible explanation | First check |
|---|---|---|
| ?utm_source=… | Campaign tracking | Whether it serves the same canonical content |
| ?s=keyword | WordPress internal search | Whether search results should be indexed |
| ?add-to-cart=123 | Commerce action parameter | Whether it generates duplicate or action URLs |
| /unknown-product-name/ | Removed or injected path | HTTP status, source and server logs |
| ?random=foreign-keyword | Bot probing or spam URL | Rendered response, redirects and security logs |
These are examples, not proof of any particular attack. Search Console can report URLs that Google discovered from external links even if you never created them.
A safe 20-minute investigation
- Export a sample
Download affected examples from the Page indexing report. Group by path, parameter name and response pattern.
- Inspect individual URLs
Use URL Inspection and a browser or HTTP checker. Record whether each returns 200, 301, 404, 410 or a server error.
- Compare the rendered page
Determine whether the URL shows your normal homepage, a search result, a redirect, a blank template or injected content.
- Check Search Console security reports
Review Security issues and Manual actions. A clean report does not replace checking files and server logs.
- Check WordPress files and users
Review recently modified files, unknown administrator accounts, scheduled tasks and unexpected plugins. Preserve evidence before cleanup.
- Choose a remedy by pattern
Fix the root cause, then apply appropriate response codes, canonical handling or URL controls.
Which HTTP response should an unwanted URL return?
| Scenario | Preferred behavior | Why |
|---|---|---|
| Content permanently removed and no replacement | 404 or 410 | Signals that the URL no longer has content |
| Content moved to a genuinely equivalent page | 301 redirect | Preserves a meaningful destination |
| Tracking parameter shows identical content | Canonical to clean URL where appropriate | Consolidates duplicate variants |
| Important legitimate content | 200 with indexable content | Allows normal discovery and indexing |
| Maliciously injected page | Remove infection, then 404/410 if no replacement | Addresses the cause rather than hiding the symptom |
Why robots.txt is not the same as removing URLs
Robots.txt controls crawling, not guaranteed removal from Google Search. If you block a URL that Google already knows, Google may not be able to fetch the noindex directive or updated 404 response. For unwanted indexed pages, first make sure Google can see the appropriate removal signal, and use Search Console’s temporary Removals tool only when immediate hiding is necessary.
What a WordPress security review should cover
- Core, themes and plugins are updated from trusted sources.
- Unknown admin users and suspicious accounts are investigated.
- Recently modified PHP files, wp-config.php and uploads directories are reviewed.
- Server access logs are checked for unusual requests and file changes.
- The site is backed up before deleting or replacing files.
- Passwords, authentication tokens and hosting credentials are rotated after a confirmed compromise.
- The site is rescanned after cleanup and monitored for reinfection.
If you discover injected Japanese-language pages, hidden redirects or unexpected shopping content, treat the incident as a security problem first and an SEO problem second. Merely removing URLs from Search Console will not remove malicious code.
A practical cleanup sequence for hacked URLs
- Contain and preserve
Take a clean backup of current files and database for investigation, and restrict access if necessary.
- Identify the entry point
Check vulnerable plugins, compromised credentials, modified files and server-level configuration.
- Remove malicious changes
Restore trusted files and clean affected database entries. Validate legitimate business functionality.
- Return correct statuses
Ensure deleted spam URLs respond with 404 or 410 rather than a soft 404 or generic homepage.
- Rebuild search signals
Update sitemaps, internal links and canonical tags for legitimate pages.
- Monitor Google
Use Search Console to watch the excluded and indexed URL trends. Reprocessing can take time.
How to prevent repeat URL explosions
Use a maintained security setup, least-privilege user accounts, strong authentication and regular backups. For sites with filters and search parameters, define which combinations should create crawlable pages. The objective is to keep useful pages accessible while preventing unlimited URL variations.
If your site has thousands of unwanted URL combinations, a developer may need to adjust application routing, server response behavior and parameter handling rather than only editing SEO settings.
Frequently asked questions
Are unknown URLs in Search Console always a sign of hacking?
No. Google can discover URLs from external links, tracking parameters and automated requests. Inspect actual responses and content before concluding there was a compromise.
Can I delete URLs directly from Google Search Console?
The Removals tool can temporarily hide URLs, but permanent cleanup requires appropriate content removal, response codes or other lasting signals.
Should I redirect every spam URL to the homepage?
No. Unrelated redirects may be treated as soft 404s and can confuse users. Use 404 or 410 when there is no relevant replacement.
Will disallowing query parameters in robots.txt deindex them?
Not reliably. Robots.txt restricts crawling and is not a guaranteed deindexing mechanism.
What if the URLs return 404 but remain in the report?
Reports and search systems can take time to update. Check live responses and monitor the trend rather than assuming a persistent infection.
Should I remove the WordPress search feature?
Not necessarily. You can manage how search-result URLs are handled without disabling a useful site feature.
Sources and further reading
First determine whether the unknown URL is harmless, duplicate or malicious
Unexpected query strings in Search Console are not automatically evidence of a hack. Tracking parameters, search filters, pagination and external links can all create variations of a legitimate URL. The important questions are whether the URL serves different content, whether it is indexable, and whether someone or something has modified your website.
| URL pattern | Possible cause | What to check |
|---|---|---|
| ?utm_source=… | Marketing attribution | Does it display the same canonical page? |
| ?s=keyword | WordPress internal search | Should search results be indexable? |
| ?filter_color=… | WooCommerce filters | Are filter combinations creating many crawlable duplicates? |
| Random letters or encoded Japanese terms | Could be spam URLs or compromised content | Inspect the actual response and server files |
| /wp-admin/ or unfamiliar PHP file | Potential probing or compromise | Check server logs and filesystem integrity |
Incident response workflow for suspicious URLs
1. Preserve evidence before making changes
Export examples from Search Console and record their exact paths and query strings. Take a backup of files and database before deleting anything. If you suspect malware, avoid opening suspicious links on an unprotected device. Use a trusted security scanner or inspect response headers and source safely.
2. Test the response with and without the query string
A URL such as /services/?abc=123 may return the ordinary services page, a redirect, a 404 or a completely different spam document. These outcomes require different remedies. A 200 response alone is not a breach indicator. Compare page titles, canonical tags, visible text, source code and HTTP status.
3. Investigate whether the content exists in WordPress
Search posts, pages, products, revisions, custom post types and media for unfamiliar titles or scripts. Check administrator accounts and recently installed plugins. Malware can also modify templates, database options, .htaccess, mu-plugins and cron tasks; searching the Posts list alone is not enough.
4. Examine the hosting environment
Review file modification times, access logs, error logs and unusual scheduled tasks. Verify WordPress core checksums and reinstall clean core files if integrity is uncertain. Replace compromised themes or plugins from trusted sources instead of merely deleting visible spam pages. Rotate administrator, hosting, database and API credentials after containment where exposure is possible.
5. Choose the correct HTTP response
Removed spam URLs that have no replacement should usually return 404 or 410. Moved legitimate content should use an appropriate permanent redirect. Do not redirect thousands of unrelated hacked URLs to the homepage: that can confuse users and obscure cleanup. Keep valid canonical pages returning 200.
6. Use Search Console for follow-up, not as a substitute for cleanup
The Removals tool can temporarily hide URLs from search results, but it does not remove malware or permanently fix indexing. After restoring the site, submit a clean sitemap and monitor Security Issues, Manual Actions and Page Indexing. Allow time for Google’s systems to process changes.
A blanket robots.txt rule can stop Google from recrawling a compromised URL and discovering that it now returns 404 or 410. Decide the response strategy first. Robots rules manage crawling; they do not reliably remove an already indexed URL.
WordPress-specific checks that matter
- Compare the live robots.txt with the file or SEO plugin setting you intended to publish.
- Check whether Rank Math, Squirrly or another plugin controls the robots output.
- Review users with Administrator access and remove accounts you cannot verify.
- Inspect wp-content/mu-plugins, uploads for executable files, and unexpected includes.
- Review recent plugin updates, backups and hosting alerts.
- Re-scan after cleanup and monitor for reinfection.
When should you involve your hosting provider?
Contact your host when files reappear after deletion, PHP processes behave unexpectedly, account-level access is suspected, or multiple sites under the same hosting account are affected. Ask for malware scan results, relevant access logs and confirmation that file permissions and account isolation are correct. A hosting provider can help identify server-level symptoms, while a WordPress specialist may still be needed to trace the application-level entry point.
How to prevent the problem returning
Use strong unique passwords and multifactor authentication, minimize administrator accounts, keep plugins and themes updated, remove abandoned extensions, schedule offsite backups and monitor Search Console for new URL patterns. For WooCommerce, plan filter and faceted-navigation indexing deliberately so legitimate product parameters do not flood the index.
Need expert help with your website?
Afix Smart Web helps Kenyan businesses with website development, technical SEO, Google Business Profile optimization and AI search visibility. Tell us what is happening and what you have already tried, so we can recommend a practical next step.
Official guidance and further reading
Editorial note: Google interfaces and verification options can change. Confirm the current requirements in the linked official documentation.
