Magento : Make Changes To Core Config Data Programmatically

Below Magento snippet is used to add/update changes to core_config_data database table.
To update Magento system configuration data for single value/field/column, you can use following custom PHP script:
define('MAGENTO_ROOT', getcwd());
require_once MAGENTO_ROOT.'/app/Mage.php';
ini_set('display_errors', 1);

try {
} catch (Exception $e) {

$readAdapter = Mage::getSingleton('core/resource')->getConnection('core_read');
$writeAdapter = Mage::getSingleton('core/resource')->getConnection('core_write');
$valueToUpdate = 'testTitle'; // It may be direct integer or any varchar depends on your need
//You just need to update the query part in like "section/group/field".
// You can get this either from database table column "path" in core_config_data or from system configuration of admin by inspecting elements from browser.
$query = "SELECT config_id FROM `core_config_data` WHERE `path` LIKE '%design/head/default_title%'";
$result = $readAdapter->fetchOne($query);
    array("value" => $valueToUpdate),

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 )

Google photo

You are commenting using your Google 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