Mass URL change in WordPress from MySQL Database

I just spent 2 of my hours to figure this thing for my client’s WordPress website. One of our client’s site somehow got redirect after changing the URLs (from where it has been changed, he even doesn’t know that). So it was my job to fix that. And of course I fixed that, but in a very engineered way.

I first took a note which table and in which column I have that old url. Then I just build some MySQL query and executed that from phpMyAdmin.

I wrote the following queries to run to replace all old url to new url. You can do it for not only URL for any kinds of texts. But, DON’T forget to take a backup of your database.

UPDATE wp_options SET option_value = replace(option_value, '', '') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET post_content = replace(post_content, '', '');

UPDATE wp_postmeta SET meta_value = replace(meta_value,'','');

UPDATE wp_usermeta SET meta_value = replace(meta_value, '','');

UPDATE wp_links SET link_url = replace(link_url, '','');

UPDATE wp_comments SET comment_content = replace(comment_content , '','');

UPDATE wp_posts SET guid = REPLACE(guid, '', '')

I wrote queries for only 2 tables but I created another few queries for you so based on TABLE and COLUMN you can replace your OLD VALUE with NEW VALUE by yourself.

The query format for who is not familiar with MySQL.


With this simple tips, you can save lots of your time for this specific use case scenario.

Supercharge WP REST API with Google App Engine

It seems that I am pretty late here to play with WordPress REST API. It’s really super cool! Now I can think about how well and fast I can distribute or work with wordpress blog posts. Even now you can host your whole WordPress inside a static HTML page. Funny? Yea, like your HTML page will interact with your REST API json response and small JS can help you to display inside page. Then you will get 10000000x super fast blog post delivery. Trust me! It works. You will understand if you are a little techie guy.

I was thinking about if I can easily get all of my posts’s data as REST API Json response then easily I can use them wherever and whenever I want. But there must be a trick. Cause still this REST API is working from inside your main WP hosting.

But what if (IF) we can recruit some middleman who can hold data and deliver those data without even interacting with your original WordPress site. So you will save lots of money and your site’s performance will be super boosted.

I just run an experiment (I shared my experimented snippet here) with Google App Engine. Why Google App Engine? Ask that to google yourself. Google App Engine is the best solutions for ready-set-go types of app deployment with lots of features that Google maintains themselves. So I am going to write a small PHP code which will load your site’s REST API JSON data and after that rest of the request it will server from directly GAE memcache. So, more easily, if your site has 1M audience a day, then most probably you will hit your original WP site once, and 999999 user will get that data from directly App Engine (PHP app data persistent through memcache).

I just tried it and it works and I tried to do 50,000 hits and it just took few milliseconds to deliver me my wordpress site’s data from Google App Engine and I just designed a HTML page with simple JS that will load the content from my App Engine and will display inside HTML page, and you know HTML page you can serve billions user in a minute. Voila 🙂

So here is my little PHP script and also I uploaded the full GAE implementation in a GitHub repository so you can directly download, change your site’s URL and deploy to Google App Engine.

 * Serve remote URL content through App Engine by using Memcache. Pretty interesting.
 * It's really cool!
 * @Author Shaharia Azam <>
define("KB_JSON_URL", "https://YOUR-WEBSITE-ADDRESS/wp-json/wp/v2");

$memcached = new Memcached();
    ['localhost', 11211, 33]

 * @param $url
 * @param string $method
 * @return mixed
function fetchJSONFromRemoteWP($url, $method = 'GET')
    $curl = curl_init();
    curl_setopt_array($curl, array(
        CURLOPT_URL => $url,
        CURLOPT_TIMEOUT => 30,
        CURLOPT_CUSTOMREQUEST => $method,

    $data = curl_exec($curl);

    return $data;


$cacheKey = base64_encode($remoteUrl);

$content = $memcached->get($cacheKey);
if (!empty($content)) {
    $data = $content;
} else {
    $data = fetchJSONFromRemoteWP($remoteUrl);
    $memcached->set($cacheKey, $data, 360000);

header('Content-Type: application/json');
echo json_encode(json_decode($data, true));


And here is the app.yaml configuration for Google App Engine

runtime: php55
api_version: 1

service: kb-wp-reverse-proxy

threadsafe: true

- url: /assets
  static_dir: public/assets

- url: /*
  script: public/index.php
  secure: always

- url: /.*
  script: public/index.php
  secure: always

- ^.git$

This snippets are available on GitHub. If you face any trouble and want to optimize your site and make it super-fast and stable with this types of solutions, reach me anytime at

[Solution] What should you do if you see Memory exhausted error in wordpress admin panel?

Recently I faced a very strange (to me) problem with my site that is I can’t see page. When I go there then I see an error something like “Fatal error: Allowed memory size of 33554432?bytes exhausted (tried to allocate 1966080 bytes) in …..“. It will make you tensed about that this error. Don’t worry. I have a solution.

But after lots of searching at last I solved it by my own brainstorming that can be strange. It’s cause because of your PHP execution memory limit.

If you are using dedicated server then you can just find your php.ini file and find ‘memory_limit’. You can change this memory_limit value to something little bigger like 64M, 256M depends on your system.

But if you are using shared hosting then you can just create a new file in your wp-admin directory of your wordpress installation. Rename that new file to php.ini and write the following code.

memory_limit = 256M ;

Now your problem is solved. Now go to and you will be able to access wordpress Dashboard homepage without any error. Happy blogging!!!

Why Joomla is favorite for Bangladeshi web developer?

?Joomla for Bangladeshi Web Developer?

I have searched a lot about this topics and also discussed with few of smart and skilled Joomla developer in Bangladesh. I am sharing the summery of this issue.

Most of the Bangladeshi webmasters are familiar with Joomla than wordpress or other CMS. They are mostly familiar with only Joomla. And most of the old aged web developers of Bangladesh are developing website in Joomla. Joomla is an old and large CMS. There are few web development training institute in Bangladesh and most of their teachers are old aged and familiar or expert in Joomla that’s why they are motivating their users to use Joomla. Even I have heard that ‘I know Joomla’ when someone meet with Job interview board. hahahaha. Just funny. Even somebody know Joomla but they haven’t any knowledge on PHP. It’s funny to me. Isn’t it?


Bangladeshi web developers are learning Joomla by being motivated by their senior web developers of GURU. But they never know the comparison about Joomla with WordPress or others. They are just following their senior guru.

90% of Bangladeshi web developer know Joomla because of their?senior guru?but they don’t know others. It’s one kind of de-motivation. It’s something like the following quote-


আমি যাহা পারি এটাই শেখো, এটা-ই সবচেয়ে ভালো.. জুমলার ক্ষেত্রেও আমাদের দেশের ওয়েব ডেভেলপাররাও তাদের শিষ্যদেরকে এটাই বলে আমার ধারনা


Facebook plugin for wordpress site

At last facebook has developed wordpress plugin to make everything easier for webmaster to integrate various kinds of features of Facebook. Facebook itself developed this plugin.

You can download the facebook plugin from?

Really it will be fantastic if webmaster can use Facebook plugin for their wordpress site. It will make more easiest way to interact with fans, users. I personally think Business website which is built in WordPress they can be?benefited?with this.