San Francisco landlords must now register their empty storefronts with the city or face a hefty annual fine.

A new law that went into effect Monday requires building owners to register a vacant or abandoned storefront within 30 days of it becoming empty, regardless of whether it is advertised for sale or lease. The annual registration fee is $711, and the cost for businesses that do not comply is a one-time penalty of $2,844.

The glut of vacancies around the city — from the Haight, the Richmond and North Beach — has long frustrated city officials, who say empty storefronts not only hurt neighborhood character, but also hurt other businesses by decreasing foot traffic in the area.

“When you have five empty storefronts on one block, you can see the damage it does to a merchant corridor,” said Supervisor Sandra Lee Fewer, who wrote the law.

The idea of the ordinance is to provide the city with a full picture of how many vacant storefronts exist. While the Department of Building Inspection already requires landlords to register empty properties, that database does not show a full picture because it is complaint-driven and self-reported.

There was also a loophole in the building code that says a commercial storefront is not considered vacant if it is “actively being offered for sale, lease or rent.” The new law improves the existing database by requiring landlords to register the property, regardless if it is up for sale, lease or rent.

The public can access the database upon request to the Department of Building Inspection.

“This is a thriving city with thousands and thousands of small businesses and thousands more entrepreneurs who want to open small businesses,” Supervisor Vallie Brown said in a statement. “There’s something almost unnatural about a storefront staying vacant too long.”

Supervisor Aaron Peskin also plans to propose a measure for the November ballot that would tax property owners with consistently empty units.

— Trisha Thadani

Trisha Thadani is a San Francisco Chronicle staff writer. Email: tthadani@sfchronicle.com Twitter: @TrishaThadani