cancel
Showing results for 
Search instead for 
Did you mean: 

Removing blocks with LOCAL.XML

Removing blocks with LOCAL.XML

Domain : audiobuy.hk

There are a few blocks with no content being reference , trying to remove them from being called with LOCAL.XML

Path : 

/home/audiobuy/production/source/app/design/frontend/universal/Hong Kong/layout/local.xml

 

However , when I remove the blocks , they still get called - is this the correct path for the LOCAL.XML file ? or should I be changing /base/ LOCAL.xml 

 

Thanks

 

3 REPLIES 3

Re: Removing blocks with LOCAL.XML

HI @audiobuy_llc 

It looks like correct path. BTW what are you removing from file.

Try once after flush the cache.

or remove var/cache folder.

I hope it will help you!

Re: Removing blocks with LOCAL.XML

*I'm removing blocks which contain empty .phtml files , eg Smiley TongueOPUPAJAXKIT
LOADER (i dont use ajax)*

*etc*

*I've made backups etc if anything goes awry.*

Re: Removing blocks with LOCAL.XML

 

  • Correct Path Check
    The correct path for overriding or removing layout blocks is indeed:
    /app/design/frontend/<package>/<theme>/layout/local.xml.
    In your case, /home/audiobuy/production/source/app/design/frontend/universal/Hong Kong/layout/local.xml should work if “universal” is the package and “Hong Kong” is the theme.

  • Do Not Edit Base
    Avoid editing /base/layout/local.xml. This is the fallback and not intended for direct changes. Always work inside your custom theme’s local.xml.

  • Check Theme Activation
    Make sure the “Hong Kong” theme is actually the active frontend theme in System > Configuration > Design. If another theme is active, your local.xml changes won’t load.

  • Clear Cache
    After making changes to local.xml, clear the Magento cache. Use:
    System > Cache Management > Flush Cache Storage or run rm -rf var/cache/*.

  • Correct Handle Usage
    Ensure that you’re removing blocks under the correct layout handle  like menu list (like <default>, <cms_index_index>, <catalog_category_view>, etc.). Wrong handles won’t affect the page.

  • Removing Blocks Syntax
    To remove a block, use:

     
    <remove name="block_name_here"/>

    Example:

     
    <default> <remove name="right.reports.product.viewed"/> </default>
  • Verify Block Name
    The name in <remove> must match the exact block name declared in the layout XML, not the alias. Double-check in the original layout.xml files.

  • Merge Priority
    Magento merges XML files. If your block is still loading, another XML (like page.xml or a module layout file) may be re-adding it after local.xml. Confirm the merge order.

  • Debugging Layout
    Enable layout hints (System > Configuration > Developer > Debug > Template Path Hints for Blocks) to see which blocks are still being called and confirm their names.

  • Fallback Confirmation
    If Magento doesn’t find your theme’s local.xml, it falls back to /base. This means if you’re not seeing changes, Magento might not be reading your file — check file permissions and spelling of the folder names (case-sensitive).

  • Test with Example (McDonald’s Menu Analogy)
    Imagine your layout loads extra empty “blocks” just like a McDonald’s menu listing empty food categories (e.g., a “Big Mac” section with no products). If you remove the wrong “category” (alias), it will still display. You must target the exact name — like removing “BigMac.block” instead of “Burgers.block.”

  • Final Step
    If all else fails, temporarily hard-comment out the block in the original module’s XML to confirm it’s the right one, then move the proper <remove> into your local.xml once tested.