• Home
    • About your Filipino Web Designer

      Hi, I'm Allan Anova—welcome to my official website. I offer professional web design and development services tailored to both personal and business needs. Want to learn more about me? Click here to view my profile.
    • What i Do? What I Offer?

      I create all types of websites—from simple one-page sites and standard multi-page websites to more complex projects like full-featured e-commerce platforms. Whatever you need, I’ve got you covered. To learn more about my web design and development services, click here.
    • Explore my Portfolio

      Take a look at some of my current and featured web projects. I’ve worked with a variety of clients across different industries. Each project showcases my skills in design, functionality, and user experience. Click here to visit my portfolio and explore my work.
  • Blog

When creating a clean website experience, it’s helpful to have your accordion modules remain collapsed when the page loads. By default, Divi’s Accordion Module opens the first item. Let’s fix that using two simple methods: custom CSS or custom JS.

Method 1: Custom CSS and an Empty Accordion Item

  1. Open the Accordion module settings.
  2. Add a new accordion item and drag it to the top.
  3. In the new item, remove both the title and body text.
  4. Go to Advanced Tab → Custom CSS → Free Form CSS and add this code:
CSS
selector {
  display: none;
}

Now, your accordion will stay closed when the page loads.

Method 2: Custom JS Code

  1. Open the Accordion module settings and set a CSS class (e.g., dt-closed-accordion) under Advanced Tab → CSS ID & Classes.
  2. Go to Divi → Theme Options → Integration tab → Header and add this JavaScript code:

For a site-wide solution where all accordions stay closed by default, use this code instead:

That’s it! Now, your Divi accordion modules will start in a closed state, offering a more streamlined user experience.