We address the electronic structure and magnetic properties of vacancies and voids both in graphene and graphene ribbons. Using a mean field Hubbard model, we study the appearance of magnetic textures associated to removing a single atom (vacancy) and multiple adjacent atoms (voids) as well as the magnetic interactions between them. A simple set of rules, based upon Lieb theorem, link the atomic structure and the spatial arrangement of the defects to the emerging magnetic order. The total spin $S$ of a given defect depends on its sublattice imbalance, but some defects with S=0 can still have local magnetic moments. The sublattice imbalance also determines whether the defects interact ferromagnetically or antiferromagnetically with one another and the range of these magnetic interactions is studied in some simple cases. We find that in semiconducting armchair ribbons and two-dimensional graphene without global sublattice imbalance there is maximum defect density above which local magnetization disappears. Interestingly, the electronic properties of semiconducting graphene ribbons with uncoupled local moments are very similar to those of diluted magnetic semiconductors, presenting giant Zeeman splitting.