What to Do If Your Website Shows Spam Pages or Posts You Did Not Write

By Munnawar Jamil ยท

Cover image for the article: What to Do If Your Website Shows Spam Pages or Posts You Did Not Write

You open your website and see an article about online casinos in a language you do not speak. You did not write it. Maybe you find several, dated the same day. This is more common than people think, and it usually means someone has gained access to the site, or to the hosting account behind it.

The worst response is to delete the posts and carry on. The posts are the symptom, and the way in is probably still open. Here is a safer order to work in.

Signs that your site has been compromised

  • Posts or pages you did not create, often about gambling, loans, pills or adult content
  • New administrator or author accounts you do not recognise
  • Visitors being redirected to other sites, especially from Google on a phone
  • A warning from Google or your browser that the site may be harmed
  • Your hosting company emailing about unusual activity
  • A sudden drop in search traffic, or odd pages appearing in Search Console

Step 1: take a backup first

Before changing anything, make a backup of the files and the database, even though they are infected. You might need it to find the way in or to recover your own content later. Store it somewhere other than the same server.

Step 2: change every password

Change the passwords for WordPress administrator accounts, your hosting control panel, FTP or SFTP, the database and the email address linked to the site. Use long, unique passwords from a password manager. Turn on two-factor login where it is offered. If several sites share one hosting account, do this for all of them, because an attacker who reaches one can often reach the others.

Step 3: review the users

Open Users in WordPress. Remove accounts you do not recognise, especially administrators and authors. Check that every account has only the access it needs. Attackers often create an author account to publish spam posts.

Step 4: update everything and remove what you do not use

Update WordPress, the theme and every plugin. Delete deactivated plugins and themes. Outdated plugins are the most common way in. If a plugin or theme was downloaded from an unofficial source, replace it with a clean copy from the official developer.

Step 5: scan and clean

Run a malware scan with a reputable security plugin or your host’s scanner. Look at recently modified files, and at unexpected files in the uploads folder. Pay attention to files you do not recognise, and to unusual code in the theme’s functions file. If you are not comfortable with this step, get help. Deleting the wrong file can break the site.

Step 6: remove the spam content properly

Delete the posts and pages you did not write, and empty the trash. Check categories, tags and the media library for leftovers. Also check scheduled posts and the sitemap, because spam sometimes hides in both.

Step 7: tell Google

Open Google Search Console and look at the Security issues report. If a warning appears, fix the problem first, then request a review. Also use the Removals tool to hide the spam addresses from search results while Google re-crawls the site.

Step 8: stop it happening again

  • Keep backups running automatically, stored off the server
  • Turn on automatic updates for security fixes
  • Limit login attempts and use two-factor authentication
  • Give each person their own account with the lowest role they need
  • Check your site and Search Console once a month

If you manage sites for other people

If you build websites for clients, spam on one of them is a warning for the others, particularly if they share hosting. Check all of them the same day. Telling a client promptly and honestly is better than letting them find out from a customer.

If you would rather hand this over, our website maintenance service covers updates, backups and monitoring, and our hosting and DevOps work can move a site onto a cleaner setup.

Need a website like this?

Talk to MJ WEB CRAFT about your project.

Start Your Project
WhatsApp Get a Quote