Wednesday, August 2, 2023

Wordpress replace wp-admin URL to our custom URL without plugin.

 

Go to the Public Html folder:-   

Step 1:-  In the root folder wp-login.php  Download the file then open it in any editor.

Step 2:-   Find all wp-login and replace them with your custom URL name ( in my case its wp-news)



Step 3:-  Upload your new  login file ( wp-news.php)

 

Go to functions.php  and paste the below code. (In my case I have to change the wp-login.php to wp-news.php)


add_filter( 'login_url', 'custom_login_url', PHP_INT_MAX );

function custom_login_url( $login_url ) {

$login_url = site_url( 'wp-news.php', 'login' );

    return $login_url;

}


add_filter( 'logout_url', 'custom_logout_url', PHP_INT_MAX );

function custom_logout_url( $logout_url ) {

$logout_url = site_url( 'wp-news.php', 'logout' );

    return $logout_url;

}

How to install WordPress in Ubuntu

 

$ wget -c http://wordpress.org/latest.tar.gz
$ tar -xzvf latest.tar.gz
$ sudo mv wordpress/* /var/www/html/
$ sudo chown -R www-data:www-data /var/www/html/
$ sudo chmod -R 755 /var/www/html/
$ sudo mysql -u root -p 



mysql> CREATE DATABASE wp_myblog;
mysql> CREATE USER 'username'@'%' IDENTIFIED WITH mysql_native_password BY 'password';
mysql> GRANT ALL ON wp_myblog.* TO 'username'@'%';
mysql> FLUSH PRIVILEGES;
mysql> EXIT;


Go the /var/www/html/ directory and rename existing wp-config-sample.php to wp-config.php. Also, make sure to remove the default Apache index page.

    


$ cd /var/www/html/
$ sudo mv wp-config-sample.php wp-config.php
$ sudo rm -rf index.html
$ sudo nano wp-config.php 

      After that you need to enter your db name , user name , password


WordPress MySQL Settings


After full fill db name, db user, db password then keyboard type Ctrl + x, Shift + Y  then hit enter.   

Afterward, restart the web server and mysql service using the commands below:


$ sudo systemctl restart apache2.service 
$ sudo systemctl restart mysql.service 


Then open a browser and hit your server name or ip address.















Wordpress mysql log file delete in mysql server disk issue

Connect server to using winscp or Fttp .

Below are the  file path:-

Folder path:-   /var/lib/mysql 
Then check their is files binlog.00234 etc.
After that delete all the file.


For deleting Mysql command.
 
Connect server to using winscp or Fttp .

Step:- 2 mysql;
Step:- 3 SHOW BINARY LOGS;
Step:- 4   PURGE BINARY LOGS BEFORE '2023-04-03 23:59:59';  (Choose your date )







wp-rocket settings

Step:1 Cache enable caching for mobile devices  Step: 2 File optimization:-      Step:3 Media                      Step: 4 Preload  Step 5 A...