Preheat the Oven:
Preheat your oven to 375°F (190°C).
Cook the Onion and Garlic:
In a skillet or saucepan, heat the olive oil over medium heat. Add the chopped onion and cook until it becomes translucent, about 3-4 minutes. Add the minced garlic and cook for another 1-2 minutes, until fragrant.
Prepare the Spinach and Artichokes:
Add the drained spinach and chopped artichokes to the skillet, stirring to combine. Cook for 2-3 minutes until heated through. Remove from heat.
Mix the Creamy Base:
In a large mixing bowl, combine the softened cream cheese, sour cream, and mayonnaise. Mix until smooth and well combined.
Combine Everything:
Add the cooked spinach and artichoke mixture to the bowl with the creamy base. Stir in the grated Parmesan cheese, shredded mozzarella cheese, salt, black pepper, and red pepper flakes (if using). Mix until all ingredients are evenly distributed.
Bake the Dip:
Transfer the mixture to a baking dish and spread it out evenly. Bake in the preheated oven for 25-30 minutes, or until the top is golden brown and bubbly.
Serve:
Remove from the oven and let it cool slightly before serving. Enjoy with your favorite dippers.