How to Duplicate a Section in the Code Editor

Topic summary

A user working with the Woodstock theme wants to duplicate a color swatch section to create a separate, independent instance. They’ve provided a screenshot showing the section they want to copy.

Two solutions were provided:

  • Check theme customizer first: Some themes allow direct section duplication through Online Store > Themes > Customize without touching code.

  • Manual code duplication method:

    1. Navigate to Edit Code in the theme editor
    2. Locate the color-swatches.liquid file
    3. Copy all code from the file
    4. Create a new section under Sections
    5. Paste the copied code into the new file
    6. Update the schema name to distinguish it as a duplicate

Important safety note: Both responders emphasized creating a theme backup or working on a duplicate theme before making code modifications.

The discussion remains open with no confirmation from the original poster about implementation.

Summarized with AI on November 1. AI used: claude-sonnet-4-5-20250929.

Hello,

I need some help! I want to duplicate this color swatch and make it a completely separate section. Could you guide me on how to duplicate this section in the code? I’ve attached a screenshot below.

Thank you so much for your time!

Theme: Woodstock

Hey! If your theme doesn’t allow duplicating sections directly in Online Store > Themes > Customize, you’ll need to duplicate the section’s code.

If you’re comfortable with code, look for color-swatches.liquid in Edit Code, duplicate it, rename it, and add it as a new section. Let me know if you need more details!

Remember ALWAYS to download a backup of your theme or work on a copy when making changes like this!

1 Like

Hi @JasonAsung

You can do that from your store admin > Sales Channels > Online Store > Themes > click “…” in the current theme > Edit code > open color swatches liquid file, copy all code, click ‘+ Add new section’ under Sections, replace code in new file with code you copied from color swatches file, change name in Schemma so you will know it is duplicate section

1 Like