How can I switch a WordPress option off from the MySQL database?

Leonard Zakoor
Leonard Zakoor used Ask the Experts™
Hey Experts!!
I have a premium WordPress theme and their support is useless. They use the customize feature of WP.

I need to remove RTL support and I figured maybe I can do this from within the DB. I found the offending part however, I have no idea how to edit it. Can you help me switch this option to off or false?


Open in new window

Obviously this column has a lot more code in it. I grabbed the snippet that I thought was most relevant.

Thanks in advance!
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2018
Distinguished Expert 2018
WordPress stores a lot of it's options in a serialized string in the DB. If these options are specific to a theme or a plugin, then you would normally set them in the WordPress admin. That would be the preferable way of doing it. Look at the Appearance -> Customize menu in your admin and you should be able to find the option in there. Look at the docs for your theme to see exactly where you do this (see my answer to your previous question)

Failing that, you could try editing the options string yourself, but if you get it wrong, you will break your site. Depending on how complex the options string is, you could just remove the entry, but you will also need to edit another part of it to ensure it is a valid serialized string. For example, take a look at the following options string:


At the start, the a:3 says that we have an array with 3 elements. One with a key of 'width' which is a 5 character string. It has a value of 300, which is a 3 character string. Then we have a 6 character key (height) with a 3 character value (300). You can't just remove part of the string and expect it to work.

If you're savvy in PHP, then you could unserialize the string, remove any necessary elements and re-serialize it:

$str = 'a:3:{s:5:"width";s:3:"300";s:6:"height";s:3:"300";s:4:"crop";i:1;}';
$data = unserialize($str);

unset($data['width']); // remove the width key

$str = serialize($data);

// 'a:2:{s:6:"height";s:3:"300";s:4:"crop";i:1;}'

Open in new window

Copy the output of the var_dump back into your DB.

If you go this route, make sure you have a solid backup of your DB (and you know how to restore it).
Leonard ZakoorSenior Front-End Developer


Thanks Chris. I set the option from 16 to 1 and it seemed to have the desired effect. The site didn't break either. Thanks again bud!!!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial