I need to update one cms page, but I have the same identifier 'home' for three pages in different stores. How can I update one page with need store.

My script has error: 'A page URL key for specified store already exists.';

$cmsPage = Mage::getModel('cms/page')->setStore('need store')->load('home', 'identifier');
    try {
    } catch (Exception $ex) {
        echo $ex->getMessage();

1 Answer 1


The problem is that load() does not care about the store id you set before, it just loads the first page it can find with the "home" identifier.

You can use checkIdentifier() to retrieve the page ID for a given identifier and store, then load the page by id:

$pageId = Mage::getModel('cms/page')->checkIdentifier('home', $storeId);
$page = Mage::getModel('cms/page')->load($pageId);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.