How to Beat Wordle Every Day! An Easy Cheat Using Browser Console

Originally posted on : https://medium.com/better-programming/how-to-beat-wordle-every-day-an-easy-cheat-3c1dc51bc4fc

2 ways to quickly solve the viral puzzle

Unlike my usual articles, this one is not about deep learning or computer vision. This is about a popular web game called Wordle.

Since I have been seeing a lot of people sharing their daily Wordle results on social media recently, it makes me curious to look into the game (or more accurately, the code logic of the game) and I found a way to cheat at it.

Disclaimer

Using this cheat is going to make the game much less fun. If you are trying to enjoy the game and simply like to discover strategies, please do not use this cheat, and regard this piece of article as a how-programmers-see-a-new-popular-web-game blog.

Method 1

  1. In your desktop browser, press F12 to open the developer tools
  2. Go to the Console tab
  3. Paste the following code into the console and press Enter on your keyboard:
(new window.wordle.bundle.GameApp).solution
It will return today’s answer to you
Bam!

Method 2

  1. In your desktop browser, press F12 to open the developer tools
  2. Go to the Application tab
  3. Click the URL under Storage Local Storage
You will see the solution word

How I Discovered

When we fill a row with a 5-letter word and press Enter, there are no AJAX calls triggered in the Network tab.

This tells us that it does not need to ask the server for the answer when it is checking whether you are correct. Therefore, it means that the answer is already stored in the client browser.

No AJAX calls

We can then add an event listener to Mouse click in the Debugger and see which line of code is triggered when we click ENTER on the virtual keyboard (which will trigger answer checking).

this.solution is what we are looking for

Now I know that the answer word is stored in a variable called this.solution . By searching solution throughout the source code, I found that solution is a property in the window.wordle.bundle.GameApp object.

Thus, what we need to do is to instantiate it using new window.wordle.bundle.GameApp , and then we can obtain the answer property by .solution .

This is just a sharing of how we can exploit web apps through dev tools in a web browser. It is not encouraged to play the game in this way. After all, you will have more fun when you guess the right word on your own.

Please note that Wordle might change their source codes or policy such that this line of cheat code doesn’t work anymore. But with the same rationale and thinking steps, you can discover the hacks of virtually any prevailing web game yourself.

Happy Hacking!

Leave a Comment

Your email address will not be published.