×
UpdatePHP Pro Log in Register
PHP expiry alert : PHP v8.1 has recently expired. Is your website still running this version? Click here for more details
SAFE versions of PHP: 8.5.12, 8.4.27, 8.3.36, 8.2.35
☰

What a hacked PHP website does to your Google rankings

PHP2Shell (CVE-2026-109618 / CVE-2026-109619) is a critical security problem in PHP itself that lets attackers take over web servers. Every website that runs PHP should be updated to 8.5.12, 8.4.27, 8.3.36, 8.2.35 or newer as soon as possible. Read our PHP2Shell check and patch guide.

Most website owners think of a hack as a security problem. It is also one of the fastest ways to lose search traffic you have spent years building. Hackers rarely deface a site any more; they quietly use it to promote their own content, and search engines are often the first to notice.

Outdated software is the most common way in. Once a PHP version stops receiving security updates, newly discovered vulnerabilities in it are never fixed. Old PHP also tends to go hand in hand with old CMS, plugin and theme versions, which is where most website break-ins actually happen. You can read more in how keeping PHP updated provides an extra barrier against hack attacks.

What attackers do to your SEO

  • Spam pages: thousands of new pages selling pharmaceuticals, counterfeit goods or gambling are added to your site. A well-known example is the "Japanese keyword hack", which fills a site with auto-generated Japanese pages.
  • Hidden links: links to the attacker's sites are hidden inside your existing pages, borrowing your site's reputation.
  • Cloaking: the hacked code shows spam to Googlebot but your normal pages to you, so the site looks fine when you visit it.
  • Redirects: visitors arriving from search results are sent to scam or malware sites, while direct visits still work normally.
  • Malware: scripts are added that try to infect visitors' devices or steal card details from checkout pages.

How search engines respond

When Google detects hacked content it may show "This site may be hacked" under your listing in search results. If it finds malware or phishing, browsers that use Google Safe Browsing (including Chrome, Firefox and Safari) can show a full-page red warning before anyone reaches your site. Either one sends most visitors straight back to the search results.

Spam pages also dilute your site. Search engines spend time crawling junk instead of your real pages, and the spam can earn your site a manual action (a penalty applied by a Google reviewer) which can remove pages or the whole site from search results until it is cleaned up.

Signs your site may have been hacked

  • A site:yourdomain.com search in Google shows pages or titles you didn't create, often in another language.
  • Google Search Console shows a message in the Security issues or Manual actions report.
  • Search Console's page indexing report suddenly shows a large jump in the number of pages.
  • Visitors report being redirected, but you can't reproduce it yourself.
  • Unknown admin users, files you don't recognise, or recently changed core files on the server.

Recovering your rankings

  1. Take a backup of the hacked site (files and database) so nothing is lost while you investigate.
  2. Find and close the way in. Update PHP, your CMS, plugins and themes, and remove anything you no longer use. Cleaning the site without fixing the hole usually means it is hacked again within days.
  3. Remove the hacked content: spam pages, injected code, unknown users and backdoor files. If you have a clean backup from before the hack, restoring it (and then updating everything) is often quicker.
  4. Change every password: hosting, FTP/SFTP, database, CMS admin accounts and any API keys stored on the site.
  5. Request a review in Google Search Console from the Security issues or Manual actions report, explaining what you fixed.
  6. Let removed spam pages return 404 or 410 so they drop out of the index. Search Console's Removals tool can hide the worst ones quickly while that happens.

Rankings usually recover once the warnings are lifted and the spam drops out, but it can take weeks. Prevention is far cheaper than recovery.

Close the most common door

Start by finding out whether your PHP version is still safe and when its security updates end. Then sign up for PHP version alerts so you hear about new security releases as they come out.

Back to Web SEO & Security Articles
Article last updated: 21st October, 2026