• Contact
  • About Me
  • Privacy Policy
  • Disclaimer
DefenceDev
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
    • Bash Scripts
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos
  • Web Tools
No Result
View All Result
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
    • Bash Scripts
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos
  • Web Tools
No Result
View All Result
DefenceDev
No Result
View All Result
Home Projects WordPress

WordPress: Change Port from 433 to 8443

by neo
November 28, 2025
in WordPress
0
WordPress: Change Port from 433 to 8443

WordPress: Change Port from 433 to 8443

0
SHARES
95
VIEWS
Share on FacebookShare on LinkedIn
Table of Contents
  • Change Default Port from 433 to 8443
  • Why to Change the Default Port?
  • Steps to Change the WordPress Port from 433 to 8443
    • Step 1: Login to the WordPress WP-Admin and Change settings
    • Step 2: Change Port Settings in your WebServer Configuration
    • Step 3: Change the Settings in Web Server Site-Available Configuration
    • Step 4: Change Settings in WordPress wp-config.php File
  • Check Settings on MySQL Server

Change Default Port from 433 to 8443

Change the default port (443) for WordPress web applications is a crucial security measure. By altering the default port (usually port 80 for HTTP and 443 for HTTPS), users can enhance protection against common cyber threats. This practice helps mitigate unauthorized access and reduces the risk of automated attacks targeting well-known ports.

Why to Change the Default Port?

However, when changing ports, it’s essential to update server configurations, firewalls, and any associated infrastructure to ensure seamless functionality and accessibility for users while fortifying the overall cybersecurity posture of the web application.

VERY IMPORTANT: CREATE THE BACKUP OF ALL CONFIGURATION FILES!

Steps to Change the WordPress Port from 433 to 8443

Step 1: Login to the WordPress WP-Admin and Change settings

Change the settings on the WordPress Settings:

WordPress General Settings
WordPress General Settings, Port Configuration

Step 2: Change Port Settings in your WebServer Configuration

Change the settings in the file: /etc/apache2/ports.conf

nano /etc/apache2/ports.conf 

Content of the file:


# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf

Listen 80

<IfModule ssl_module>
        Listen 8443
</IfModule>

<IfModule mod_gnutls.c>
        Listen 8443
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
<IfModule mod_ssl.c>
Listen 8443
</IfModule>

Step 3: Change the Settings in Web Server Site-Available Configuration

Change the settings in the file:

nano /etc/apache2/sites-available/wordpress-le-ssl.conf

Content of the file:

<IfModule mod_ssl.c>
<VirtualHost *:8443>
    DocumentRoot /home/defenced/public_html
    <Directory /srv/www/wordpress>
        Options FollowSymLinks
        AllowOverride Limit Options FileInfo
        DirectoryIndex index.php
        Require all granted
    </Directory>
    <Directory /home/defenced/public_html/wp-content>
        Options FollowSymLinks
        Require all granted
    </Directory>


ServerName domain.com
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/domain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/domain.com/privkey.pem
</VirtualHost>
</IfModule>

Step 4: Change Settings in WordPress wp-config.php File

Change the settings on the file nano /home/defenced/public_html/wp-config.php

define('WPSITEURL','https://domain.com:8443/');
define('WPHOME','https://domain.com:8443/');

Check Settings on MySQL Server

Connect to your MySQL Server

# Connect to the MySQL Serber
mysql -u root

Select correct database, in my case it is wordpress

use wordpress;

Check the settings save in the wp_options table:


# Execute the following query to check the settings:
select * from wp_options where option_name='siteurl';
select * from wp_options where option_name='home';

In case that you need to update this, use the following updates statements:

# In case that you need to update the values:
update wp_options set option_value='https://domain.com:8443' where option_name='siteurl';

update wp_options set option_value='https://domain.com:8443' where option_name='home';

defencedev.com

Tags: wordpress
Previous Post

WordPress: Install Certbot Certificate on Your Site (Let’s Encrypt)

Next Post

Ubuntu: Running Commands in Background Using Terminal

neo

Related Posts

WordPress: Automatically Website Backup with Bash Script on Linux
WordPress

WordPress: Automatically Website Backup with Bash Script on Linux

WordPress: Renew HTTPS Certificate on WordPress Site
WordPress

WordPress: Renew HTTPS Certificate on WordPress Site

WordPress: Install Certbot Certificate on Your Site (Let's Encrypt)
WordPress

WordPress: Install Certbot Certificate on Your Site (Let’s Encrypt)

WordPress: Installation on Ubuntu 22.04
WordPress

WordPress: Installation on Ubuntu 22.04

Next Post
Solutions: Run Command in Background on Ubuntu

Ubuntu: Running Commands in Background Using Terminal

Recommended

Install Ubuntu 22.04 on Oracle VM Virtual Box

Install Ubuntu 22.04 on Oracle VM Virtual Box

Configure Linux Server and Immich SNAP Application Monitoring with Monit

Configure Linux Server and Immich SNAP Application Monitoring with Monit

Terminal Colors in Bash: How and When to Use Them

Terminal Colors in Bash: How and When to Use Them

Solution: Ubuntu Internet Connection Monitoring Script (Create a Log File, Possible to Send per Email)

Ubuntu Internet Connection Monitoring Script: Log Creation and Email Alerts

DefenceDev Public GitHub: Scripts & Automation

DefenceDev Public GitHub: Scripts & Automation

Categories

  • Blog
  • Cloud
    • Private
  • Linux Tutorials
    • Bash Scripting Tutorials
    • Commands
    • Networking
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Solutions
    • Docker
  • Video Tutorials
    • MikroTik Videos
  • Web Tools

DefenceDev Tutorials

defencedev Logo

Whether you’re just starting or looking to expand your skills, I hope you find useful information and engaging discussions here. Let me take you through my journey and the goals behind this space!

Follow Us

Recent News

Terminal Colors in Bash: How and When to Use Them

Terminal Colors in Bash: How and When to Use Them

Solution: Ubuntu Internet Connection Monitoring Script (Create a Log File, Possible to Send per Email)

Ubuntu Internet Connection Monitoring Script: Log Creation and Email Alerts

  • Site Map
  • Privacy Policy
  • Facebook Page
  • GitHub
  • Disclaimer
  • Contact
  • About Me

© 2025 defencedev.com - All rights reserved.

No Result
View All Result
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
    • Bash Scripts
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos
  • Web Tools

© 2025 defencedev.com - All rights reserved.