WordPress use CDN with out plugin

Content Devlivery Network (CDN) allow your web site to serve images from another domain or a sub domain. This speed up web site as your web server don’t need to serve images. Also browsers have a limit on number of parallel downloads from same domain. Having images on a differnt domain bypass this limitation of web browser.

If you use a pull type CDN or a CDN that you manually upload using some sync tool, you need to rewrite all image url to CDN url. There are several plugins available to do this. But you can easily do this with out any plugins.

Edit file

Add following code to end of the file.

This will replace image urls with CDN url.

WordPress Avada theme icon missing

WordPress Avada theme load fontawesome from old site

I have migrated a web site using Avada WordPress theme.

Once site is migrated, i edited wp-config.php file and added following to avoid site getting redirected to old website url.

Now site works, but some of the resources are loaded from OLD site url, this breaks some of the icons.

WordPress Avada theme icon missing

On Browser Developer tool console, it show following errors

Using URL replacement plugins like Better Search Replace or Velvet Blues Update URLs did not fix the problem.

To fix the it, login to wp-admin. Click on “Avada” on left menu, select Theme Options

wp-admin > Avada > Theme Options > Import/Export

Under Export Options, click on “Download Data File”, this will ask you to save theme configuration file as a .json file, for me it saved fusion_options_backup_02-08-2019.json.

Next click on “Import Contents from File” button. It will show a text area, paste content of the json file you downloaded in previous step here and click “Import”. This will fix the problem related to fonts loading from old url.

WordPress CLI

To install WordPress CLI, run following command

To list all users in wordpress, run

To create an Administrator user, run


WordPress debug

If you have a wordpress web site that give blank screen, you can add following to wp-config.php to enable displaying errors.

This should be added above line


WordPress Backup and Migration Plugins

Migrate Guru: Migrate & Clone WordPress Free

This plugin allow you to transfer your wordpress web site to another hosting for free. It support sites upto 200 GB in size. Use BlogVault to do the transfer.


All-in-One WP Migration

This free plugin allow you to backup and restore your wordpress site. Free version support sites upto 500 MB. If your site is larger, you need to use paid version of this plugin.

To remove 500 MB limit, edit file


Replace with



WordPress CherryFramework lessphp fatal error

On a WordPress site using CherryFramework based theme, was getting following error.

This was due the web site have migrated to a new server and the path in new server was differnt than old server.

To fix, edited file

On line 157, you see following code

Replace ith with

You will be able to login to wordpress admin area. Once you logged in, go to theme settings and just update, this will update the paths. Now you can remove the change you done in less-compile.php

Change WordPress URL

Method 1: Editing MySQL backup

To change WordPress site url, backup your MySQL database.

Run sed command to replace the URL in MySQL backup file.

Restore the new db-modified.sql, that will have the database with URL changed.

Method 2: Using Plugin

Edit your wp-config.php and add following line.

if you want site avialble on multiple URL

You can also edit the wp_options table

Now you need to use some wordpress plugin to change URL in database, here are some useful plugins for changing site url.

See WordPress

Running wp-cron with cronjob

By default wordpress run cronjob everytime user visit your web site. This is bad idea for busy site.

To run wp-cron with cronjob, first edit wp-config.php and add following

Now set cronjob.

if you have wp-cli installed, use following cronjob

If you don’t have wp-cli installed, use

Replace /var/www/html to actual folder where your wordpress installation is located.