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

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?

s:16:"thim_rtl_support";

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!
Leonard ZakoorSenior Front-End DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Chris StanyonWebDevCommented:
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:

a:3:{s:5:"width";s:3:"300";s:6:"height";s:3:"300";s:4:"crop";i:1;}

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);
var_dump($str);

// '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).
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Leonard ZakoorSenior Front-End DeveloperAuthor Commented:
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!!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Query Syntax

From novice to tech pro — start learning today.