How To Change the Database Port for WordPress

WordPress is an open source content management tool. It is written in PHP and MySQL. Sometimes it becomes necessary to change the database ports as it helps your website against port scans that can be done through port sniffing websites. By changing the port over time, you can add a layer of safety to your database. In this guide, we will explain how you can change the database port of your WordPress website by following these simple steps.

Prerequisites

  • WordPress cPanel Credentials
  • FTP application
  • Text Editor (Sublime, Notepad)

Step 1:

Log into your cPanel provided by your web hosting company.
You need to access the WordPress directory through the cPanel. You can access it through the File Manager in the cPanel or connect to the WordPress directory using a FTP application like Filezilla.

Step 2:

Click on File Manager. You will see a list of files and folders.

You need to go inside the public_html folder to access the wp-config.php file
.

Step 3:

Now, locate the wp-config.php file inside the public_html folder and right click to edit it. On clicking edit you will see a Text Editor box.

Click Edit to make changes to wp-config.php file
.

Step 4:

Search for the keyword DB_HOST. You will find a port address of the database after DB_HOST keyword.

Change your new database port address
and Click Save Changes.

Conclusion:

By following these simple steps, you can easily change the database port of your WordPress site. This adds an extra layer of protection against sniffers.

 

Check out these top 3 WordPress hosting services:

HostArmada
$1.79 /mo
Starting price
Visit HostArmada
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.5
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.0
IONOS
$1.00 /mo
Starting price
Visit IONOS
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.0
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.3
Ultahost
$2.90 /mo
Starting price
Visit Ultahost
Rating based on expert review
  • User Friendly
    4.3
  • Support
    4.8
  • Features
    4.5
  • Reliability
    4.0
  • Pricing
    4.8

How To Change The WordPress Database Prefix To Improve Security

This guide will teach you steps of changing the WordPress Database Prefix to imp
2 min read
Max Ostryzhko
Max Ostryzhko
Senior Web Developer, HostAdvice CTO

How to Find Out the Database Details of Your WordPress Website Using cPanel

This how-to guide explains different ways to find out the database name and pass
3 min read
Arvind Singh
Arvind Singh
Hosting Expert

How To Examine And Repair A Database in PhpMyAdmin

Over the period of time, database can be corrupted and needs to repaired. This t
1 min read
Elizabeth Grom
Elizabeth Grom
Hosting Expert

How To Clean Meta Data In A WordPress Database

Overtime, we should clear up metadata in our database. This tutorial will guide
1 min read
Avi Ilinsky
Avi Ilinsky
Hosting Expert
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top