As you know friends, WordPress platform is the topmost platform for all blogging geeks. If you are using some security plugin on your WordPress, such as WordFence Security plugin for WordPress, then you will be notified when someone tries to access your admin account. SQL injection for hacking purpose are famous in the script injection attack. When a new blogger install WordPress in root folder then he or she don’t know that this is the most guessable location for hacker. They target your core file of WordPress. But if you shift your WordPress core files to a different location which is not easily guessable for hackers, then chances of hacking becomes less. However the process which I am going to describe how to move wordpress to a custom directory. It can be very hectic for some webmasters, so first thing make sure you have made a full backup of your WordPress blog. You can revert the changes if something goes wrong after moving wordpress directory.
Table Of Contents
Steps for moving WordPress Core files to a different directory
- First thing to make new directory, where you will move WordPress Core library files. Go to your File Manager and make a new directory there. The directory should be as below as possible from root. The possibility I am talking about because you have to type that location in address bar every time you want to login to your admin panel. public_html>dir1>dir2>core
- Now you have to download the following file from your current installation directory normally in your public html folder.
- Wp-admin folder
- Wp-includes folder
- Wp-content folder
Also download php files from the public_html folder viz. index.php, wp-comments.php, wp-config.php, wp-activate.php, wp-config.php, wp-blog-header.php, wp-atom.php and others php file if present.
Download the .htaccess file.
- Now you have to upload the all downloaded file to the directory which you have created in the step 1.
Important Changes to be Made
- Login to your WordPress Dashboard and navigate to Setting->General. Now change the WordPress Address URL to the url you have made in step1. In this case: http://techgeekers.com/dir1/dir2/core. Now save the changes.
- Now download the Index.php file. In this file search for the require(‘./wp-blog-header.php’); . now change this to require(‘.directory_path/wp-blog-header.php’);. In this case require(‘./dir1/dir2/core/wp-blog-header.php’);. Save the changes. And upload it back on the same folder.
Now because you have move WordPress core files setting, your login URL for admin area will be changes. In this case
Deleting of files from the old WordPress Directory
If everything is going till this step then you should go for deleting some of your old installed file. You can delete the all files from your old WordPress installation except of wp-content, index.php and .htaccess file. Remember wp-content folder contains the uploaded item in it. So don’t delete it. If you will delete this folder you will face problem in your previous posts such as missing images.
Hope you guys have done this whole process by following easily understandable steps described above and successfully moved wordpress to a custom directory.Hackers need a source to attack but if you will hide the source then it will be not an easy task for hackers to crack your admin area. However, if you have any problems then you can tell us freely. Comments about your problems are welcomed.