A client once asked me how many posts WordPress can support. At the time, I thought the question went too far and casually answered that WordPress could support an unlimited number of posts. Later, while working on a web application and reviewing the WordPress database design, I noticed that the ID fields in WordPress database tables use the bigint type. That made me realize that the amount of data a WordPress database can store is not actually limitless.
So how many posts can WordPress support?
What is the limit then? I tested it in a very direct way:
Edit the post ID field directly in phpMyAdmin, then hold down the
9key on the keyboard for about a minute, and finally click Execute.
phpMyAdmin reports an error. Ignore that error, refresh the table you just edited, and you will see that the post ID has become 18446744073709551615. That is the maximum number of posts WordPress could theoretically support based on the field type. After looking it up, I found that “18446744073709551615” is a 20-digit natural number equal to 2^64 - 1. There is also a well-known story related to numbers of this scale:
Once upon a time, a king ordered that an interesting board game be invented. Someone eventually created a game that satisfied the king’s requirements: chess. The king decided to reward the inventor and asked what gift he wanted. The inventor replied, “My request is simple. Put one grain of rice on the first square of the chessboard, then place twice as many grains on each following square as on the previous one. When all 64 squares are filled this way, that will be my reward.” The king thought this was a tiny reward and agreed immediately. But when his mathematicians calculated how much rice would be required, the king was shocked, because he could not possibly provide that much rice.
Can a WordPress database really store that many posts?
In reality, a lot of content in WordPress is stored as posts, including revisions, pages, media items, menus, and custom post types created by plugins or themes. All of that consumes IDs, so WordPress cannot truly store that many actual articles.
Even if nothing else were added and only normal posts were stored, supporting 18446744073709551615 posts would require an unimaginably powerful server. At that point, the question would no longer be whether the database field type can support the number. The infrastructure required to reach that scale would become the real limit long before the database ID field does.
