The most common type of WordPress tampering these days is the hacking of WordPress sites for SEO purposes. We will explain this SEO spam.


Typical Symptoms of SEO Spam

SEO spam is a vulnerability in WordPress or a weak password for the administration panel that is exploited by brute force to seize administrative privileges and execute altered files on the WordPress site.
Typical symptoms of SEO spam include the following

The sitemap is rewritten, and pages from e-commerce sites are registered in search results that the user has no knowledge of.

A large number of the fraudulent pages are actually placed on the server.

When you access the site, you are redirected to another site.

Only visitors coming from search results are redirected to a different site.

Links to specific sites are inserted in the header or footer without permission.

Incorrect keyword lists are inserted in the header or footer.

Illegal advertisements or pop-ups are inserted into the site

Illegal JAVASCRIPT code is inserted into a post, or an unidentified page is posted without permission.

Purpose of SEO Spam

The reason hackers deface sites and install malware to perform SEO spam is to profit from the influx of traffic via search engines and the search results themselves.
The objectives of SEO spam are as follows

1 Increase traffic to any given site

Forcing access to a site to skip to another site or registering a rogue page or sitemap in search results because the hacker gains some profit by increasing access to that rogue site.

2 Increase the search ranking of any given site

Search engines determine rankings based on a system whereby if a site has more links from external sites, it is rated higher and moved up in the search rankings.
For this reason, by tampering with WordPress and adding links on your own, you can aim to increase your search ranking. If there is a link near the keyword for which the search ranking is to be increased, the search ranking of the linked page will be increased according to the nearby keyword.
This is the reason why keywords are illegally embedded by hackers.

3 Affiliate

Hackers profit by tampering with WordPress sites to illegally obtain advertisements for affiliate purposes and link clicks on the site.

Eliminate SEO spam

WordPress defacements are often hidden so deep in the system these days that it is often difficult to find them all by hand.

However, the trend is that tampering is often embedded in files that are executed whenever any page on a WordPress site is accessed.

Examples would be the following files
index.php
wp-config,php
header.php of the theme
theme’s footer.php
theme’s functions.php
theme’s single.php

Reference
10 files in which malicious JAVASCRIPT code is embedded when WordPress is tampered with

If you are looking for the files visually, download the files from the server, check the above files first, and if there is malicious code embedded in them, carefully remove and re-upload only those parts.

SEO spam can be detected and removed mechanically from the database and files.
Free WordPress:Malware Scan & Security Plugin [Malware and Virus Detection and Removal].
You can also try