SAN FRANCISCO — Last Friday, the Walmart in Beeville, Texas, placed an innocuous Facebook advertisement for cans of baked beans. There was just one problem.

They were Bush’s baked beans. And even though the brand has nothing to do with the former presidents, Facebook’s algorithm has no way of knowing that. The ad was taken down, one of many nonpolitical ads that have been hit by Facebook’s new guidelines for political advertisers.

The Walmart ad for baked bans that Facebook's system flagged.

A Nestle advertisement encouraging veterans to “thrive” in the workplace was removed, as was a P&G ad touting the company’s commitment to LGBT+ inclusion. The Rev. Clinton McFarland’s first name appeared to get an ad from the Grace Baptist Church in Atlanta removed. The list goes on and on, and the examples are easy to find after a little digging through Facebook’s new political ads archive.

In an effort to avoid the rampant platform abuse that continues to fester on Facebook, the company announced in April that anyone seeking to run an “issues” advertisement in the United States would have to verify their identity and location, and the ads would run with a “paid for” label. Facebook also instituted a program that scanned ads to check if people were trying to sidestep its system, which has now flagged a variety of nonpolitical ads.

The ad from a reverend that Facebook's system flagged.

Facebook’s efforts are meant to bring a new level of transparency to political advertising on Facebook and protect users from the sort of fake news that foreign agents spread on the site during the 2016 election, an issue the company initially minimized.

But the shortcomings of Facebook’s filter come as the U.S. prepares for the 2018 midterm elections, the first since the widespread manipulation of social networks by Russia was first brought to the public’s attention.

Automated systems are far from perfect and Facebook has said they have some work to do to ensure they get this right.

A Facebook spokesperson said in a statement: "This is a new policy and a new process. Review and enforcement won’t be perfect — we’re working on the ways our technology can improve detection — but it’s important that we start."

The statement added that Facebook is purposefully being cautious.

"We certainly don’t want to unnecessarily flag advertisers, whether small businesses or local organizations," the spokesperson said. "But it’s critical that we err on the side of being more transparent to prevent election interference."

The Facebook ad filter has also hit media outlets, which have been flagged for posts on politics and issues that they have paid Facebook to promote, which Facebook counts as ads. A report by ProPublica found that the filter had stopped some news articles while also missing ads that were clearly political.

Facebook's ad filter stopped this ad from P&G.

Last week, Facebook COO Sheryl Sandberg hosted a press event at the company’s headquarters in Menlo Park, California, to debut more advertising transparency tools, including the ability to go to a page and see every advertisement it is running and even search the ads by country.

Sandberg said Facebook is doing more to review political ads, even though some advertisers have complained about delays. Sandberg said it was all a “part of the cost of the checks and balances we are putting into the system.”

“We underinvested in prevention,” she said. “We underinvested in proactively policing the ecosystem that we have built.”