Debugging theme mods

When developing themes, it can be useful to see what theme mods (setting values from get_theme_mod()) are set for your themes at the database level. However, this information is serialized, making it difficult to access, read, and modify while testing.

I’ve been relying on two tools for this sort of work lately: Sequel Pro and the Online PHP Unserializer.

Sequel Pro is a Mac-only, open-source tool for working with MySQL databases; it’s much faster, robust, and intuitive than PHPMyAdmin, and easier to work with than MySQL Workbench. The Online PHP Unserializer does its one thing, and does it well.

Copying serialized data from the database back and forth from the Unserializer makes it easy for me to troubleshoot mod settings, revert to previous values, or zero out certain values without having to delete the whole row from the database. This can be invaluable when testing code for the Customizer, or anything involving multiple themes at the same time.

If you have other troubleshooting tips, or any other tools to suggest than those above, let me know!

Published by

Kirk Wight

I am a Code Wrangler at Automattic, helping make the best it can be. Pender Island, British Columbia, Canada is where I call home. Lover, not a fighter.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s