Forensic malware removal · Backdoor & SQL cleanup · Credential rotation · Search Console security review

Clean a hacked WordPress site in Morocco

Your WordPress or WooCommerce website shows Japanese spam results, malicious redirects, or a Google Chrome red warning? I perform a methodical source-code and SQL forensic cleanup, close the entry vulnerability, rotate server credentials, and prepare your Search Console security review—without erasing your business data.

Observed infection symptoms and targeted remediation steps

Removing Japanese keyword hacks, pharma spam, and injected URLs in WordPress

Typical scope: altered index.php / .htaccess files, rogue XML sitemaps, and Googlebot cloaking.

Observed signs
  • Japanese characters, pharma keywords, or spam snippets showing on Google results for your domain
  • Thousands of fabricated URLs served dynamically via rogue PHP routers or modified .htaccess rules
  • Unauthorized XML sitemaps or unknown verified owners added inside Google Search Console
Forensic cleanup actions
  • WordPress core checksum verification against official releases and removal of injected PHP routers
  • Cleanup of .htaccess rules, rogue XML sitemaps, and unauthorized owners in Google Search Console
  • Returning clean HTTP 410 / 404 statuses on spam paths so Googlebot gradually drops injected URLs on recrawl

Stopping malicious mobile redirects and hidden phishing folders

Typical scope: obfuscated JS injected in SQL tables (wp_posts / wp_options), altered themes, and phishing paths.

Observed signs
  • Mobile or search visitors redirected to external scam pages while logged-in admins see the normal site
  • Obfuscated JavaScript payloads injected inside wp_options, header/footer hooks, or theme files
  • Hosting provider warning or temporary account suspension triggered by a hidden phishing directory
Forensic cleanup actions
  • Targeted SQL database inspection (wp_posts, wp_options, wp_postmeta) to strip malicious script tags
  • Clean reinstallation of WordPress core, parent themes, and plugins from verified upstream packages
  • Removal of unauthorized server folders and preparation of an incident remediation note for your hosting provider

Full server cleanup prior to submitting a Google Search Console security review

Typical scope: Chrome "Deceptive site ahead" warning or Search Console "Security issues" alert.

Observed signs
  • Google Safe Browsing red warning displayed across Chrome, Safari, or Firefox blocking customer visits
  • Active alerts inside Google Search Console Security issues or disapproved ad campaigns due to compromised software
  • Immediate drop in visitor access and interrupted inquiries or WooCommerce checkout flows
Forensic cleanup actions
  • Complete eradication of flagged payloads across all directories (including wp-content/uploads and subdomains)
  • HTTP response verification against every sample URL flagged by Google Search Console
  • Submission of the Google Search Console security review request (review timing depends strictly on Google with no fixed timeframe guarantee)

Closing hidden PHP backdoors, rogue administrators, and malicious WP-Cron tasks

Typical scope: hacked site that gets reinfected hours or days after a basic plugin scan.

Observed signs
  • Deleted malware files reappearing automatically shortly after a superficial cleanup attempt
  • Unauthorized administrator accounts regenerated via hidden mu-plugins or rogue WP-Cron schedules
  • Executable PHP files hidden inside wp-content/uploads, altered wp-config.php, or outdated/nulled plugins
Forensic cleanup actions
  • Inspection of wp-content/mu-plugins, wp-content/uploads, and server cron / WP-Cron schedules
  • Disabling PHP execution inside uploads, purging unauthorized admins, and rotating WordPress SALT security keys
  • Full credential rotation (WordPress, MySQL, FTP/SFTP, SSH, cPanel/Plesk) and plugin vulnerability remediation

Three-stage forensic method to clean and stabilize a compromised WordPress site

01.

Snapshot backup & full file/SQL audit

Isolate a full snapshot before intervention, compare core checksums, list recently modified files, inspect wp-config.php, .htaccess, mu-plugins, uploads, and locate injected SQL payloads.

02.

Malware eradication & access rotation

Reinstall clean WordPress core, themes, and plugins from official sources, remove rogue administrators and backdoors, update vulnerable extensions, and rotate SALT keys, DB, FTP/SSH, and admin credentials.

03.

Hardening & Search Console review prep

Block PHP execution in uploads, tighten file permissions, remove unauthorized Search Console owners or rogue sitemaps, set HTTP 410/404 on spam URLs, and file the Google security review request.

Technical verification checklist during WordPress cleanup

Layer Compromise state Technical action Expected state
WordPress core & themes Altered core files (wp-load, index.php), injected theme templates, or hidden mu-plugins Checksum audit against official WordPress releases, clean core replacement, and line-by-line theme cleanup Clean PHP file tree preserving your existing visual theme and published content
Plugins & entry vectors Abandoned plugins, unpatched vulnerable versions, or pirated/nulled packages Clean update or replacement from official repositories and removal of unmaintained extensions Closure of the initial entry vector to significantly reduce reinfection exposure
SQL database & user accounts Injected scripts inside wp_posts / wp_options, poisoned cron jobs, and rogue admin users Targeted SQL cleanup, active session invalidation, unknown user removal, and password rotation WooCommerce orders, posts, customer records, and forms preserved in a sanitized database
.htaccess & Uploads directory Rogue redirect directives and executable PHP web shells placed inside wp-content/uploads Restoring clean .htaccess directives, removing PHP files from uploads, and blocking script execution Direct execution blocked for scripts inside uploads while keeping all images and PDF assets intact
Google Search Console & review Active Safe Browsing warning, unauthorized Search Console owners, and indexed spam URLs Revoking unauthorized owners, serving clean 410/404 statuses on spam URLs, and filing security review Clean site ready for Google’s security review (review queue times vary by Google and are not guaranteed)

Clean, maintained business platforms engineered in Morocco

Preventive follow-up: TMA maintenance, WordPress rebuild, and SEO recovery

Once cleaned, keep extensions updated via ongoing TMA maintenance, stabilize an aging build, or audit post-incident Google indexation.

Related expertise in this service area

Maintenance & security →

Frequently asked questions on cleaning a hacked WordPress site

How can a hacked WordPress site be cleaned without losing posts or WooCommerce orders?

Before touching live files, an isolated diagnostic backup of files and SQL data is created. WordPress core, plugins, and parent theme files are replaced with verified clean upstream packages, while wp-content/uploads and SQL tables are selectively sanitized so your existing pages, media, customers, and WooCommerce orders remain intact.

Why does my website display Japanese pages or spam links inside Google search results?

This pattern is typically caused by a Japanese keyword hack or cloaking script: injected PHP code serves spam pages to Googlebot while showing normal pages to human visitors. Once the malicious files, altered .htaccess rules, and unauthorized Search Console owners are removed, spam URLs are configured to return HTTP 410/404 so Google gradually drops them during subsequent crawls.

How long does it take to remove a Google Safe Browsing warning or spam results?

Once the server is thoroughly cleaned and verified, a security review request is submitted via Google Search Console. Review turnaround is controlled exclusively by Google and cannot be guaranteed: Safe Browsing warnings are often lifted within a few days after clean verification, whereas removing thousands of cached spam URLs unfolds gradually over multiple Googlebot recrawls.

Why does a basic WordPress antivirus plugin sometimes fail to prevent reinfection?

Security plugins rely largely on signature matching and can miss obfuscated backdoors, rogue administrator accounts, compromised neighboring folders on shared hosting, or the unpatched plugin flaw that caused the initial breach. Manual forensic cleanup paired with full credential/SALT rotation and patching vulnerable components addresses the root cause.

Which access credentials are required in Morocco and how is the intervention structured?

To diagnose and clean effectively, temporary access to your hosting panel (cPanel, Plesk, or SSH/SFTP), WordPress admin, and Google Search Console (when warnings or SEO spam exist) is typically required. Remediation usually takes from a few hours up to 48 business hours depending on infection scope, with a clear itemized quote approved beforehand and post-cleanup hardening guidance.

Technical guides on WordPress security, hosting in Morocco, and performance