Hacked WordPress: what to do in the first hour (Canada and Quebec)

Order matters more than panic. This checklist covers the hour after you discover the compromise, then what Quebec’s private-sector privacy act (Law 25) and PIPEDA may require if personal information is involved. It is not legal advice, and it is not a substitute for a competent security person.

WordPress.org’s FAQ: my site was hacked is still a useful technical reference. The Commission d’accès à l’information du Québec and the Office of the Privacy Commissioner of Canada prevail over any summary.

Timeline of the first hour after discovering a hacked WordPress site, in order: 1) write down what you see, the time and who told whom, and take screenshots, without cleaning anything yet; 2) work from a clean computer; 3) copy the files and the database as they are, off the server, and ask the host for access logs, keeping that copy as evidence, not a clean backup; 4) take the site offline at the host or firewall, and do not delete infected files before review; 5) change passwords for hosting, SFTP or SSH, the database and every WordPress administrator, from the clean machine; 6) tell the host and ask them to freeze the logs; 7) do not put the site back up until the way in has been found. Steps 3 and 5 are marked to do first. Next: is this a privacy incident? The steps are listed in full below.
In the first hour: contain the site, keep evidence, and change access before any cleanup.
Timeline of the first hour after discovering a hacked WordPress site, in order: 1) write down what you see, the time and who told whom, and take screenshots, without cleaning anything yet; 2) work from a clean computer; 3) copy the files and the database as they are, off the server, and ask the host for access logs, keeping that copy as evidence, not a clean backup; 4) take the site offline at the host or firewall, and do not delete infected files before review; 5) change passwords for hosting, SFTP or SSH, the database and every WordPress administrator, from the clean machine; 6) tell the host and ask them to freeze the logs; 7) do not put the site back up until the way in has been found. Steps 3 and 5 are marked to do first. Next: is this a privacy incident? The steps are listed in full below.
In the first hour: contain the site, keep evidence, and change access before any cleanup.

In the first hour

  1. Write down what you see, the time, and who told whom. Take screenshots. Do not “clean” anything yet.
  2. Work from a clean computer, not from an admin session already open on a doubtful machine.
  3. Copy the files and the database as they are, off the server, and ask the host for access logs before they rotate. That copy is evidence; do not later restore it as a “clean backup.”
  4. Take the site offline at the host or firewall (a 503 page), not by installing a maintenance plugin on an already compromised WordPress. Do not delete infected files before they have been reviewed.
  5. Change passwords for hosting, SFTP or SSH, the database, and every WordPress administrator account, from the clean machine. Revoke application passwords, remove unknown users, and regenerate the keys in wp-config.php.
  6. Tell the host and ask them to freeze the logs.
  7. Do not put the site back up until the way in has been found. Restoring a backup from before the incident is not enough if the same hole is still there.

Do the copies and password changes above first.

Next: is this a privacy incident?

As soon as the site holds personal information (forms, accounts, donations, a newsletter, client files), treat the compromise as a possible privacy incident, not only as a technical problem.

In Quebec, a confidentiality incident that presents a risk of serious injury must be reported diligently to the Commission, and the people concerned must be notified. The organization must also take reasonable steps to reduce the risk and keep a register. The form and explanations are on the Commission’s site: confidentiality incidents (businesses) and the notice form. This is not the CNIL: for a Quebec organization, it is the Commission d’accès à l’information.

In Canada (PIPEDA), if your organization is subject to it, a breach of security safeguards that presents a real risk of significant harm must be reported to the Office of the Privacy Commissioner, affected people must be notified as soon as feasible, and all breaches must be recorded. See What you need to know about mandatory reporting of breaches and the real-risk-of-significant-harm assessment tool.

Involve the privacy officer in that assessment. Do not announce “no data was affected” until you have looked at the logs and the copies.

For the wider Quebec framework, including notice and what a website owes people, see Guide Loi 25.

Some links on this page may be referral links. If you use one, we may earn a commission, at no extra cost to you.