About WBL, what it does or doesn’t do for you
WBL is a measure of expectation, the expectations the designers had for items and wealth. These expectations affect other aspects of the game—perhaps most notably monster design. Monster save DCs account for cloaks of resistance, their own save bonuses account for the ability-score-enhancing headbands, and so on. To a certain degree, the CR of a monster is based on the assumption that certain tools will, or won’t, be available.
This is important. I would caution very strongly against mucking with it too much, and would suggest that the game does not work well if you do unless you also put a lot of effort into addressing how things will work with more or fewer wealth. I also routinely remind people that it’s crucial to remember that this is wealth we are talking about—the sum total value of the current gear enjoyed by the character. Consumables already used, obsolete equipment that’s been sold off, that isn’t part of wealth. And wealth is best calculated using its value to the character in question, which may be different from what the book says it is or what NPCs are willing to pay for it. In other words, wealth should only count if it’s actually usable, because WBL is supposed to be a measure of power derived from property. That is the sole reason it has any use.
At the same time, WBL can only, at best, allow you to match designers’ expectations. This can allow CR and other tools to work more reliably. But these tools aren’t all that reliable, even at the best of times. This means that keeping to WBL is very far from a magic bullet—but it also means that straying too far makes a bad situation worse, so take that for what you will. And something really important: this goes in both directions. In fact, going under WBL is often worse than going over WBL, assuming the magnitude of the difference is equal.
Moreover, there are concerns aside from balance to worry about—narrative flow, consequences for player actions, and so on—that also have to be accounted for. For instance, selling off obsolete items only gets you half that item’s value. Used consumables don’t mean you immediately stumble upon a tidy little pile of gold pieces equal to its value. And gold, for that matter, doesn’t immediately or automatically turn into the items you want, and money in your pocket doesn’t actually help you with most challenges in that form. Because it would be absurd if it did, and because it would mean that, e.g., consumables wouldn’t actually cost anything, which isn’t quite right.
What this all amounts to is that WBL is a rough goal, not a fixed state. Wealth should, and indeed must, fluctuate around WBL. This is absolutely required and certainly not a “problem” that needs immediate remedy. Attempting to do so is often heavy-handed and blatantly metagamey, which can and does ruin immersion at times. In severe situations, that is entirely appropriate, but since wealth is always fluctuating, doing so every time wealth strays from WBL is going to result in doing your game more harm than good.
Finally, one last note on what WBL is decidedly not—economics. WBL blatantly flies in the face of the very concept of economics, an arbitrary value expected without any mechanism whatsoever in place determining that value. That is because WBL is about character power far, far more than it is about money. It’s a purely game-design issue, not an economic one. And this is important because Pathfinder does not have sane or stable economic rules. They cannot withstand even the barest critical inspection; WBL basically states that gp has to go up in concert with XP, but almost all of the minimal economics in the game are largely divorced from XP-acquiring activity. This is generally “balanced” by the fact that most of them offer extremely small amounts of money relative to simply going out and acquiring loot, but not all wealth-generating activities are. WBL itself, for that matter all of Pathfinder, offers no solution to this dilemma. The general assumption is that it won’t matter because Pathfinder characters are “supposed” to go out and adventure. It’s another expectation baked into the system.
Now then, with an overly-lengthy introduction finished, let’s discuss remedies.
Before the game/out of game
As discussed above, Pathfinder largely ignores these problems because it’s assumed that players will largely do so as well, because their interest is in adventuring. After all, they are playing Pathfinder, that’s what the system is for. It’s based on Dungeons & Dragons, a system developed for and focused on dungeon-delving and dragon-slaying. To a certain extent, Pathfinder doesn’t have, and doesn’t want, sophisticated mechanisms for handling economic activity. It’s the wrong system for that.
When the group is playing Pathfinder, there should be at least the minimal buy in that the group is playing an adventure and their characters are adventurers. If that isn’t the case, if characters seriously want to stay in safe locations and participate in the world’s economy, then Pathfinder is a terrible system to use for the game. It doesn’t have any depth whatsoever in that area, and the rules it does have will hurt the campaign more than they will assist.
Bonus XP can be awarded for cleverly making money
This can be dangerous, because it might encourage trying to ignore Pathfinder’s focuses and strengths and trying to use it for a game that would really be better off in another system. However, Pathfinder is also very limited in terms of its economics, and it still may be the right system for a campaign about adventurers who still have some economic prowess—and in that sort of situation, you need answers.
One answer for that can be to award XP for successful wealth-generating schemes. This can cause problems with your plans (you’ll have to make them tougher, since you’re dealing with higher-level, higher-wealth characters than you [or the AP] were planning on), but increasing level increases the expected WBL—which means that the players’ greater wealth is more in line with their level. The idea here is to fight skew, that is, characters who are too strong in one way but not particularly strong in another, which makes it difficult to find appropriate challenges. Increasing level in this way can actually make things easier to balance, since XP and gp are enjoying a relationship closer to what was expected.
Houserule to maintain expectations
Some tricks are just too good, generate too much wealth. Houserules to nix them are heavy-handed, but these kinds of things should be discussed out of game, and comes back to the idea of buy-in from the players. “Congratulations, that’s a clever idea, but it’s also going to mess up the game we’re trying to play, so we’re going to have to adjust it so it’s less good.” Hopefully, they’ll accept that (buy-in), and hopefully, you can do it ahead of time, before they sink too much into trying this scheme.
Talking to your players and having good communication about expectations and plans is key here—as it is in the entire game. Allowing the player some benefit, or to enjoy the full benefit briefly, can also be decent approaches to mitigate disappointment here. Framing also helps: “Your trick was so good that we had to change the rules to keep things competitive” is one of the most impressive statements that society has for competitors. Pathfinder isn’t a competitive game, but the feel-good effect of that kind of framing is still valid.
You can also houserule things to make the economy react in ways that are a little more realistic, to prevent tricks from turning into the kind of run-away success that generates substantially-higher-than-expected income on a continuous basis.
Behind-the-scenes number fixing
Subtlety in handling WBL is to be strongly encouraged—since wealth is fluctuating constantly, you do not want it to be obvious that you are managing it at all. Otherwise it will be rather like railroading, and have the same problems.
Instead, acquisition of significant wealth should result in advantages—temporarily. Loss of significant wealth should likewise result in disadvantages—temporarily. And you should quietly adjust the wealth that the players are seeing in later loot to bring things closer to WBL. It’s OK if they’re over or under for a level, possibly even two. WBL grows pretty quickly with level, so even if players find a major windfall, if they then gain XP without gaining gp for a while, they’ll often pretty quickly reach a level where the wealth they have is entirely appropriate. Likewise, adventuring often produces substantial finds all in one place.
And in the meantime, you can try to tweak challenges to account for deviations in wealth. This is more difficult, and the rules have less guidance for you, but it also has the advantage of allowing those with more wealth—who take on greater challenges than they otherwise might at their level—to acquire XP faster, while those with less wealth—who are constrained from taking on everything they might at their level with normal wealth—from gaining more XP too quickly and pushing the disparity further.
This is the bread-and-butter of managing WBL. This is how you should usually handle disparities. And it’s OK if it takes quite a bit of time. But it doesn’t handle truly dire situations where the numbers are simply off by too much.
Way too little wealth: side quests and non-combat challenges
Lack of WBL is a huge problem in Pathfinder, in part because there are classes that barely manage as it is, and rely heavily on the items they can acquire to shore myriad weaknesses. One great way to handle this situation is with challenges that provide targeted wealth (things characters desperately need), and do so without requiring wealth. Most of the “hard requirements” on wealth are about combat, so challenges that rely less on combat—either involving relatively simple fights or none at all—are great opportunities to introduce this wealth. This works best if it’s at least partially player-directed. When your party is struggling, suggest that the characters could take some time to apply their skills and regroup. Ask for Diplomacy checks, Survival checks, Knowledge checks, and so on to find long-lost treasures, rich patrons who need things done, and the like. It’s a large, magical world. As long as they aren’t on a forced march of a quest, they can take some time to find some of that wealth they’ve been missing.
This is also, by the way, a fantastic opportunity for plot hooks. A team of adventurers is struggling, needs better gear? A shady anonymous benefactor might be able to supply them, but now the team doesn’t know who they’re working with, don’t know what favors might get called in. Or maybe there was a reason that relic was left, untouched, in that temple for so long—and maybe it means someone in the party is the chosen one, or maybe it means there was a subtle and dire curse they’ll only learn about later. And so on.
Way too much wealth: you could just leave it alone
It is possible for players to gain far too much wealth and have far too powerful toys available for their level, without actually requiring a response from you. So they take on tougher enemies than they should, they accomplish more than they otherwise would—you can always just throw more at them. This gives them more XP and allows them to reach the level where their wealth is appropriate sooner. It accelerates the game, which can be a problem, but isn’t always. Not always appropriate, but an option to consider.
Obviously, only works if the wealth was the result of a one-time thing. Much-too-high income is more problematic.
Way too much income, or too much wealth you can’t leave alone: Get heavy handed
You do have to get heavy handed sometimes. Other answers here give many options for doing this, which mostly revolve around stripping characters of their wealth. This works, but it can feel bad, and it doesn’t address the problem of too much income if that’s what you’re dealing with.
As a result, you will probably have to combine this with a little bit of letting the players enjoy it. That is, the above suggestion of just leaving it alone will have to apply at least somewhat. This mitigates the “feels-bad-ness” some (by giving the players at least some time being overpowered), and gives more time, which may increase their level (reducing the problem even if it doesn’t fix it) and allow you to set up something more subtle than blatantly taking their toys away.
The ideal case for handling things when they get really bad is to make their tricks obsolete or inapplicable, rather than outright taking them away. Ultimately, the biggest problem with being overpowered, whether from having too much wealth or otherwise, is that it becomes too easy to just apply the same solution to all problems. When you have a really good hammer, all the world still looks like nails even when you have other stuff. Taking away the nails is often a better approach than taking away the hammer.
But sometimes you have to. I urge you to limit how often you do, to try to avoid that situation in the first place, but it’s part of the game. When you can do it judiciously, rather than regularly, it can also improve the game, even better if you never had the problem in the first place—after all, a big set-back like that is a great story.
Really severe problems with too-powerful toys: address out of game
If your campaign literally cannot continue without removing some item or items from the players’ possession, and you do not have a good in-character way to do so, even a heavy-handed one, just own up to the problem. GMing is not easy, mistakes happen. Your group should understand that. Admit you made a mistake allowing them to get the item(s) and that you need to remove them or nerf them to keep the game workable. Discuss as a group how they’d like that to go. Some might prefer some deus ex machina in-character explanation over nothing, others might prefer that the item gets quietly ignored and forgotten, and still others might rather you just ret-con it out of the game. They may have ideas for nerfing it without completely removing it, and they might have ideas on how to justify that in-character.
And when you do this as a group, almost all of the problems go away. The idea is to find a solution that allows the game to get back on track. To make people satisfied with where the game is going. A lot of the problems of being heavy-handed go away in this case.