How can I update Magento 2 store config values programmatically
You can use same method as add Magento 2 store core config.
$configData = [ 'section' => 'YOUR_SECTION', 'website' => null, 'store' => null, 'groups' => [ 'YOUR_GROUP' => [ 'fields' => [ 'YOUR_FIELD' => [ 'value' => $yourValue, ], ], ], ], ]; $configFactory = \Magento\Framework\App\ObjectManager::getInstance()->get('Magento\Config\Model\Config\Factory'); $configModel = $configFactory->create(['data' => $configData]); $configModel->save();
Magento 2: Programmatically Add A Store Config Value