Your wordpress website may get infected when you use Unknown
root source themes or plugins or the password you set too easy to hack so the
malicious code is normal.
When a website is infected with malicious code, there are
usually three categories as follows.
First: your homepage
has been moved to the hacked announcement, followed by a great music or a
picture parody you.
Second place: your website sexaam silently send out phishing
e-mail, Continuous spam on hosts you will never know
Third: Your website will contain links to dirty web sites,.
And if you fall into one of the above cases then the
provider will lock your hosting. If you have used VPS you will be warned or blocked website if it
falls into the case number 1.
You will now be ranked lower in search results on google, and
will be red when browsing the web using the chrom browser to warn you that your
site is not secure.
But do not worry, there are ways hack will also prevent
hacking. Just do not use theme or pirated plugins or set password is long and
hard to remember, you do not remember the best (just kidding, do not follow) or
simply install itheme security is ok.
What if your site is infected with malware then?
Do not worry then there is a way to solve the problem.
How to solve when the
site is hacked?
When your site is infected Instinctively, you will go to
google query how to remove malicious code or how to remove the virus for your
website. But sadly, no tool can help you free, and if you want to remove the
virus you have to accept to pay a very expensive price.
After deleting your site is not completely sure the only way
to completely remove the virus is to reinstall website again.
Installing a website from scratch is the only way to get
your website clean installing a website does not mean that you will rewrite the
content or the product because the data will be saved to the database, but the
good news is that no malicious code attaches to your database either.
Installing the website means that we will retrieve the soft
data stored in the database on the old site, then install the new website and
import the data into it, then reset the plugin and theme from the beginning
with clearer source.
Steps to reset your website from scratch
Step 1: Install a new website
Now you are installing a new wordpress website on the host
or localhost and use a new domain name to run this website to ensure that you have just visited the new
website and the old site for easy checking and comparison.
Then open the wp-config.php file of the new website and insert
the following into <? Php:
01
02
|
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');
|
Change example.com to the new website address.
Step 2. Backup data on the old site
For the first backup you have to phpMyAdmin to export data in
the database being used and downloaded to your computer or you can simply use
the backup plugins to down load the database.
Next is bring the folder containing the image in the upload, /
Wp-content / uploads / as 2017, 2016, 2015, 2014, ... about your computer you
have to make sure that you only download the folder that contains the upload
image for your safety.
If you use Hosting then you can go to File Manager using
Compress to compress these folders and download. Or if you install a new
website on the same host, you do not need to download, just copy the directory
to / wp-content / uploads / in the new website directory.
Step 3: Import old data into new website
To this step you have to access phpmyadmin at the host or
localhost running the new website and find the database name of the website. Then
click on import and upload the .sql file that you had in step 1.
During the import database process, there will be some errors.
If you get an error when importing the database, create a new
database and import it into the new database. Then set up the website using the
new database offline.
Enter the name of the data sheet with prefix “wp_” or another
prefix.
If you use a prefix name other than wp_, open the wp-config.php
file at the new website, find $ table_prefix, and replace wp_ with the prefix
of the database table. For example, if you have a table named 38dug_options in
the database, it will change to:
01
|
$table_prefix = '38dug_';
|
Then upload the image files in the old website running on the
host (wp-content / uploads) to the wp-content / uploads directory in the new
website to ensure the image is not lost.
To test, you can access the Media Library on the new website
to see if the image is fully displayed. If the image shows normal then it is
complete.
Step 4:
Reset the originating theme for clarity to be more secure
To this step is simple you just need to find a theme that
fits your field. If the theme uses the best paid theme should buy the copyright
of the theme to be sure, update to the latest version to prevent tigers.
Then you should install the plugins to secure your wordpress
like itheme security.
Step 5:
Upload the source code to the main website
Once you have completed the site setup steps When you start
using the new web go to hosting and delete all the data in the old web, then
transfer the source code of your newly created website to the host directory of
the main website.
To do the fifth step you have to do two small steps.
1.Backup and restore the new website source code to the host.
2.Backup database and restore database on host.
After the transfer completes, open the wp-config.php file of
new and improved wordpress WP_SITEURL is the main website address. Example:
01
02
|
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');
|
This can ensure that you can access the new website by your
own domain name.
Step 6:
Change the website address in the database
Now log on to the new website on the host and install the
plugins Better Search Replace, Then go to Tools -> Better Search
Replace and find the old domain name in all the database tables and change to
the new domain, uncheck Run as dry run as shown below.
So all the clean links on your old site will be redirected to
the new website, It's not manual, so you can still keep your google ranking.
Last step. Set up security for WordPress website
This is the most important step .
Do you still remember the reason that you have to install
wordpress back from the beginning?
This is because of malware infection, So after completing the
new web setup steps you have to make security settings for your website secure.
And above all, you should use the theme and plugins have a
clear origin to avoid being attacked.
If you do not install something strange on your website,
complex admin password, good security plugin setup, then you will not need to
worry about security solutions anymore.
Wish you never be infected for your website
0 comments:
Post a Comment