Wardrobe shelves made of flimsy materials are annoying to look at when they sag beneath the weight of their contents and in extreme cases may even collapse, causing breakage and inconvenience. It is worth the extra expense to acquire shelving material to hold whatever you want to put on the shelf. The expense will soon be forgotten, but the strong shelves will endure.
Unless you're putting extremely heavy things on your wardrobe shelves, solid wood should be adequate for the task. Spruce is a softwood that is one of the less expensive woods available on the market, and, although it is not as strong as some hardwoods, will probably support anything you want to place on it. You can build a shelf out of 2.5 cm (1 inch) thick pine boards or be extra safe and just buy spruce 5 cm x 10 cm (2 x 4 inch) boards and line them up to create a shelf. 5 cm (2 inches) of solid wood, no matter what the species, will hold a lot of weight. Alternatively, you can make attractive hardwood shelves out of oak that will be strong enough to hold anything that you care to set on them.
Plywood is a very strong material that is resistant to both sagging and warping. The main reason for this is its construction; plywood is made out of five layers of wood, with the direction of the grain alternating, which helps to eliminate weaknesses caused by grain direction by creating a crisscross structure of strength. Plywood shelves can be further strengthened by doubling up the layers of plywood or by cutting 5 cm (2 inch) wide strips and attaching them in a stand-up position to the bottom of the shelves. Gluing and nailing these strips to the bottom of the plywood makes the shelf far more resistant to sagging under weight.
MDF stands for medium density fiberboard, which is a sheet product, usually sold in sheets that are 1.2 x 2.4 m (4 x 8 feet) in size, that is made up of reprocessed paper waste. MDF isn't as strong as solid wood or plywood but works fine for wardrobe shelves. One way to make MDF more resistant to sagging is to avoid using it to span more than 90 cm (3 feet). If you are putting it into a wardrobe that is 60 cm (2 feet) wide, this isn't a problem. In a wide wardrobe with folding doors, you can build a partition or other divider in the centre of the wardrobe. This allows you to put an MDF shelf on each side of the partition that only needs to span half the width of the wardrobe. You can also add strengthening strips to the bottoms of the MDF shelves in the same manner as the plywood shelves.