Category: CMS

Change WordPress URL through functions.php file

Changing the WordPress URL can be done by editing the functions.php located in the theme folder, in most of the webservers the location will be as below /home/site/public_html/wp-content/themes/mytheme/functions.php Once you open the functions.php files add the below lines (replace the URL with the new one) immediately after <?php   update_option( ‘siteurl’, ‘’ ); update_option( ‘home’, […]

Install PEAR/PHP Mail function

  PHP Mail function should be installed on your server if you want to send emails from your code, to install 1. Install Pear package (if it is not already installed) by running Debian/Ubuntu: apt-get install php-pear Redhat/CentOS: yum install php-pear 2. Once the pear installation is complete or if you have PEAR already installed, […]

Error: “An error occured” in Joomla admin section

  After installing the latest version of Joomla you may sometimes notice the below error in the “admin” section. Error An error occured Screenshot:   Fix: This happens because of the incorrect/low MySQL “sort_buffer_size”, to fix this edit the “my.cnf” file vi /etc/my.cnf Add the below line to the end of the file sort_buffer_size = […]

Restrict WordPress Admin to Specific IP’s

It is always advised to restrict wordpress admin section to specific IP to avoid brutforce attacks, to configure it add the below code in the .htaccess file of your wordpress domain   <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_URI} ^(.*)?wp-login\.php(.*)$ [OR] RewriteCond %{REQUEST_URI} ^(.*)?wp-admin$ RewriteCond %{REMOTE_ADDR} !^$ RewriteCond %{REMOTE_ADDR} !^$ RewriteRule ^(.*)$ – [R=403,L] </IfModule>  

CMS: Get complete list of all installed CMS’s on Server

  The following scripts may be very handy to get all the list of CMS’s on various servers. WordPress: cPanel: find /home/*/public_html/ -type f -iwholename “*/wp-includes/version.php” -exec grep -H “\$wp_version =” {} \;   Plesk: find /var/www/vhosts/*/httpdocs -type f -iwholename “*/wp-includes/version.php” -exec grep -H “\$wp_version =” {} \;   Joomla: cPanel: find /home/*/public_html/ -type f […]

WordPress: Change URL in Media and Posts

  After changing the wordpress to the new website, it is observed that the URL of media files and Internal post links still shows the OLD url. To change it, login to MySQL server and select the wordpress database and run the below query.   UPDATE wp_posts SET post_content = REPLACE(post_content, ‘’, ‘’);   Note: […]

WordPress does not take max_memory limit from PHP.ini

  New Versions of wordpress does no take the max_memory_limit from PHP.ini. This is because the wordpress default memory limit is already defined in the following file.   WORDPRESS_ROOT/wp-includes/default-constants.php   If you want to modify, edit the above files and change the memory in the following lines   define(‘WP_MEMORY_LIMIT’, ‘YOUR_VALUE’); define( ‘WP_MAX_MEMORY_LIMIT’, ‘YOUR_VALUE’ );   […] © 2016