Preheat your oven to 375°F (190°C).
- In a large pan, heat olive oil over medium heat. Add the chopped onion and cook until softened and translucent, about 5 minutes.
- Add the minced garlic and cook for another 30 seconds until fragrant.
- Stir in the chopped spinach and cook until wilted and any excess moisture evaporates, about 5-7 minutes. Remove from heat and let it cool.
- In a large mixing bowl, combine the cooled spinach mixture, feta cheese, eggs, dill, salt, and pepper. Stir until everything is well incorporated.
- Brush a 9×13-inch baking dish with melted butter. Place a sheet of phyllo dough in the dish, and brush it lightly with butter. Repeat this process, layering about 8-10 sheets of phyllo dough, brushing each sheet with butter as you go.
- Once you have layered the phyllo, spread the spinach and feta filling evenly over the dough.
- Continue layering more phyllo sheets over the filling, brushing each one with butter. Aim for at least 8 more layers, making sure the filling is fully covered by the dough.
- Once the spanakopita is fully assembled, tuck in the edges of the phyllo to seal the pie and brush the top with more butter.
- Using a sharp knife, lightly score the top of the spanakopita into squares to help with cutting later.
- Bake for 45-50 minutes, or until the phyllo is golden brown and crispy.
- Let the Spanakopita cool for a few minutes before slicing and serving.