When you’ve gotta go, don’t go to Starbucks.

Seven months after the coffee kingdom declared its toilets open to all — no purchase necessary! — visitors who hear nature’s call are finding it isn’t always easy to lighten their loads.

Finding a usable Starbucks toilet in the Big Apple might actually have gotten harder since last spring’s announcement — and not just for non-customers.

Starbucks CEO Kevin Johnson declared the open-toilets policy after two black men were infamously arrested in a Philadelphia Starbucks. They asked to use the toilet and were told it was for customers only. When they sat to wait for a friend, they were handcuffed and charged with “trespassing.”

But a Post survey found some supposedly liberated loos in different Manhattan neighborhoods closed to everyone.

It’s bad news given that a 16-ounce “grande” drip coffee can contain a bladder-bursting 320 milligrams of caffeine.

A half-dozen toilets were locked or barricaded for no clear reason. Others were closed for prolonged “cleaning,” which an insider said was needed after extreme soiling caused by drug-using, incontinent vagrants.

“Letting everybody in has resulted in nobody getting in,” an employee at one branch fumed.

“Rest Room closed,” declared signs at 399 Seventh Ave. (entrance on West 32nd Street) and at a branch at Pearl Street and Maiden Lane. At 252 W. 31st St., the road to relief was blocked by garbage cans. Furniture and boxes formed a barrier at 61 W. 56th St.

A rope and traffic cones barred the way at 38 Park Row. When a desperate visitor asked if the loo would reopen any time soon, a barista directed him to a Dunkin’ Donuts nearby.

After The Post asked for explanations from Starbucks’ Seattle headquarters, corporate spokesman Reggie Borges said that all the shuttered rest rooms had reopened.

But signs posted on about one-third of Manhattan’s Starbucks toilet doors pee on the new policy — they still say, “for customer use only.”

Most Starbucks toilet doors also sport numerical punch-code panels. Although some post the magic number, many don’t.

Borges said, “Yes, some stores are still in the process of removing the signs.” He said it wasn’t “as simple as using a screwdriver. Our stores have to work with landlords to make sure they’re appropriately removed.”

Then he switched gears and said, “As soon as someone enters our door they are considered a customer whether they buy anything or not.”

As for the punch codes, “They don’t mean that you’re not allowed to use the rest room.” But, “We are reconsidering them and might do away with the punch cards. If a barista won’t give you the code, you should call it to a manager’s attention,” Borges said.

The new open-toilets rule pushed by Starbucks chairman Howard Schultz was supposed to help the chain repair the damage to its socially conscious reputation — which includes “community outreach” and a “fair trade” policy with its Third World suppliers.

Starbucks toilets can be an adventure even when they’re open. At Broadway and 47th Street on Thursday, the separate men’s and women’s rooms were suddenly plunged into darkness, sending panicked customers fleeing to the bright lights of Times Square.