How To Change the Database Port for WordPress

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:

A2 Hosting
$2.99 /mo
Starting price
Visit A2 Hosting
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.0
  • Features
    4.5
  • Reliability
    4.8
  • Pricing
    4.0
HostArmada
$2.49 /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
Hostinger
$2.99 /mo
Starting price
Visit Hostinger
Rating based on expert review
  • User Friendly
    4.7
  • Support
    4.7
  • Features
    4.8
  • Reliability
    4.8
  • Pricing
    4.7

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