You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Performance: Slow loading of tags and categories on sites with large amounts #10169
Crowded blog with 100 categories and thousands of tags (750.000 articles).
Trying to add a category gets a delay so big that the showing up of categories can take up to 30 seconds !!. The same thing is happening on tags.
We are using Yoast SEO and we already tried to disable it and it is not the cause. Even when categories and tags are set, trying to "show" the current settings is painful as opening a post could take 30 seconds or more for current categories and tags show up. This lead to many of my writers incorrectly adding repeated tags as they won't show up on time. The VERY AGGRESIVE autosave feature is also something that affects the delay.
Reacted by Will Skora, Bozz, Nick, Shizumi Yoshiaki and Ari
I will work on a way to generate several thousand tags for testing, and this is exactly the kind of issue that opt-in testing helps uncover. I appreciate that you have reported this!
Thanks so much for your reply. Yes, it does seem like Gutenberg is not designed for big blogs as having tons of categories and tags makes it almost impossible to handle. There must be something wrong on the way Gutenberg ask for that information.
I will work on a way to generate several thousand tags for testing
WP-CLI is pretty helpful for this:
wp term generate category --count=1000
Trying to add a category gets a delay so big that the showing up of categories can take up to 30 seconds !!. The same thing is happening on tags.
#6694 is potentially related. However, it would be useful to track down whether the source of your slowness is: 1) purely from the amount of data, or 2) caused by some plugin or your theme causing slowness (in addition to the amount of data).
Reacted by SimonDesautels
Reacted by Sheri Bigelow, Mark Root-Wiley and Velda
Quick editor is instant, classic editor is ultra fast, clearly gutenberg
is doing something wrong
El jue., 27 sep. 2018 12:09 p. m., Daniel Bachhuber <
notifications@github.com> escribió:
I will work on a way to generate several thousand tags for testing
WP-CLI is pretty helpful for this:
wp term generate category --count=1000
Trying to add a category gets a delay so big that the showing up of
categories can take up to 30 seconds !!. The same thing is happening on
tags.
#6694 <#6694> is potentially
related. However, it would be useful to track down whether the source of
your slowness is: 1) purely from the amount of data, or 2) caused by some
plugin or your theme causing slowness (in addition to the amount of data).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#10169 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AF8Y6wxvGDM4WlIa-BwAybr01aF5wdqcks5ufOo-gaJpZM4W5Er1>
.
I think the problem is related to the following:
The current implementation does not use the state management system due to #11643. Currently, this results in a lot of API Requests instead which slows down the whole process.
It's impossible for me. It slows down so much that I prefer to do a "quick
edit" and add the tags by that method than trying to deal with this
slowness and unresponsiveness. Clearly this technique is not working.
El vie., 16 nov. 2018 a las 4:17, David Remer (<notifications@github.com>)
escribió:
I also have the same problem, sometimes I type a lot of tags and immediately disappear and re-write again. then I tried to wait for the autocomplete and sometimes it suddenly disappeared. is it possible to use same system on classic editor?.
I am also having the same issue when entering tags. Sometimes it is using so much memory it slows my system to a hault. Is there any way to use the old system for tags where it saves them when you click to update the post instead of when you are typing them in?
Loadnig of 50 categories takes about 3-4 seconds, which is kinda usable.
Hower typing tags (3023 at the time of writing) is real problem. If I type multipe tags at once they dissappear. Selecting tag from search results kinda helps, but loading takes more than 10 seconds.
I have a few thousand tags, and this is a serious issue for me. Especially because my server is pretty slow, so each API call is about a 1 second response time. It's basically paginating non-stop.
Seconding all of this and confirming that if I deactivate Rest API for certain post types, the Category/Tag AREAS load instantly in Classic editor. Have noticed similar issues where Featured Image, Category, and Tag areas all loads last in the WP Admin sidebar. Often 10-20 secs after the rest of the admin, content of the post, etc is all loaded. It seems to be something with Rest API and the order in which the admin loads.
In the video I posted here, you can see Categories and Tags loading way after (and also note that before they load, they do not show up as an option in Preferences #55460 (comment) (< video is comment on this post)
The site overall has 18 categories and 28 tags for normal posts. Even in a CPT with 3 categories, this slow loading occurs. So really not the numbers that are the source of some of the delays mentioned above.
In the attached screenshot, you can see it's one of the last things to load on the page and takes many MS.
Although this is a "backend" issue, it really is front-facing in the sense that our clients see this. Ultimately it affects the entire ecosystem of designers, developers, etc who evangelize custom Wordpress sites to clients as a great product overall but a bug like this makes the client think Wordpress is hard to use when things don't appear sometimes or take a long time to appear.
The REST API requests themselves are quite fast on my local site. If they are slow for you, I'd suggest looking into profiling those requests with XHProf.
From what I read in this issue and see in my own testing, the main problem is that the editor only renders the categories panel after paginating through all the categories, which is slow if you have hundreds of those. And there's not even a spinner or anything. #29393 would solve this (and yes, maybe it can be solved as part of #61852). So I'd recommend focusing on that part first and foremost.
Thanks for flagging this issue. Currently, the Core Performance team is primarily focused on performance issues that affect end users of the site and not as much performance issues that are encountered in the admin. Even so, it's possible that this demonstrates a potential issue affecting core APIs that needs to be fixed.
FWIW I second this. The Gutenberg team is fare more experienced with the editor architecture and React performance best practices. It doesn't make sense for the core performance team to "take over", but of course we can help where possible.
Reacted by George Mamadashvili, Weston Ruter, Karthik Thayyil and Adam McFadyen
I think the remaining issue here is with hierarchical taxonomies, such as categories, where the editor must make unbound requests (perPage: -1) and wait until all responses are returned before rendering any content. This was confirmed in recent tests by @supernovia.
Considering some recent improvements to the data layer, I think I've some ideas how to fix this. A good start would be to display intermediate results, along with a loading indicator in the right places, to communicate that data fetching hasn't finished yet.
I'm going to assign the issue to myself and will try to PR for the proposed solution.
Reacted by Pascal Birchler, mgrenierfarmmedia, martymi, Bozz and Velda
@Mamaduka visual feedback for the user experience and intermediate results would really help! Very good idea.
Curious how you think "intermediate results" might be handled.
One approach might be that if a site only has, say, 10–12 or less categories, it simply outputs them as checkboxes (like Classic).
If there are more than 10, it proceeds with the new method. I guess these are what we might call Conditionals?
Jetpack's slideshow has conditionals this way... when there are less than X images, it displays dot indicators for the # of slides. If there are more than X, it shows "X of XX"
These types of approaches sort of follow what's called PROGRESSIVE DISCLOSURE, where the user experience is improved by only showing users what they need at any given moment. And not showing too much or having a complicated solution when it's not warranted.
Curious how you think "intermediate results" might be handled.
It will try to build the "tree" with the first 100 results and display a loading indicator. Unfortunately, the current design/structure requires fetching all categories to build the UI, so we're limited in how much "progressive disclosure" or "virtualizing" techniques can be applied.
@Mamaduka we did some related work in Calypso for building comment management, where some sites and even some posts had thousands of comments in a big tree, and the tree was not chronological either (some very old comments would get very new responses).
we built a new API to power this which provided a trimmed-down tree of the hierarchical comments which is then used to quickly render the UI structure while the UI lazy-loads the content. this is how we were able to get the pagination working without loading all of the comment data, and then have the first page loaded fast and first.
you can see it at the Developer Console for wordpress.com. You can enter /sites/mysite.mydomain/comments-tree to see it for any site you may have there.
in some experimentation I found more-optimized ways of sending this rather than as a JSON data structure which cut the size down substantially, and grabbing all of the data from the database was optimized as well.
if you think this is of use here I’d be happy to expand on it. it doesn’t look like the general-purpose API endpoints but it was built to power a UI panel that could not wait until 10,000 comments loaded from the normal one. in fact though, this is how we build effective, simple, and performant APIs rather than re-exporting the database through generic CRUD interfaces, but that’s a story for another time.
Reacted by Adam Silverstein and George Mamadashvili
@dmsnell, thanks for sharing a great example. I think we will eventually need similar sub-endpoints to represent hierarchical data in various places, such as Panels and DataViews. IIRC, @oandregal worked on something related for the post types, though it also had some performance implications. Ref: #66479 (comment).
My current solution is somewhat naive and uses a recent experimental feature to render results as they're received from the server - #71402.
I couldn’t tell from the linked comment what was causing the performance issues, whether it was the API fetch or the UI rendering.
One note about what we built with the comments-tree — we abandoned WP_Query(). Now I don’t know if that’s relevant here because when we built that I wasn’t aware that we could add 'fields' => 'id=>parent`` and get the parent and child ids. Still, it’s an avenue to consider because I vaguely remember hitting performance-relevant issues with WP_Query` vs. a raw SQL query.
[RECEIVE_INTERMEDIATE_RESULTS]
Hm. Nice. That was an inevitable need given the way the data fetching assumes requests start and end and give no introspection to that process.
Another thing I experimented with was sending HTTP chunked data, or of simpler mechanisms to flush the output buffer while building a request.
The thing with the comments-tree was that it was fast enough and small enough to send in its entirety to the browser, which let the UI instantly render as it wanted, even with blanked-out data (spinners or skeletons instead of tag names, etc…). Then normal fetching and caching kicked in and the data appeared progressively by nature, not by code.
While it appears like RECEIVE_INTERMEDIATE_RESULTS might work on pagination, if we use chunked encoding or buffer-flushing we actually want to use JS’s progressEvent to track the download. This also requires using something like a partial JSON parser, or LD+JSON. But, it’s a simple method to start getting content from the server to the UI much much faster.
Hm. Nice. That was an inevitable need given the way the data fetching assumes requests start and end and give no introspection to that process.
Right, there's not a lot you can derive from core data resolution statuses, but it works for most of our current cases.
You can also use currentItems and totalExpectedItems state with RECEIVE_INTERMEDIATE_RESULTS flag to display more interactive loading states. I tried that initially, but it was decided to use the spinner instead.
Another thing I experimented with was sending HTTP chunked data, or using simpler mechanisms to flush the output buffer while building a request.
I've used server-sent events in the past for some client project, and it was a project I really enjoyed.
Shipping similar specialized endpoints seems to go against WP philosophy, but it would be great to see how far we can push the limits with existing or new general APIs. Which you're already doing with HTML API 🦸
P.S. If you have any resources for optimizing/rendering large data trees on the client, please share 😄
Shipping similar specialized endpoints seems to go against WP philosophy, but it would be great to see how far we can push the limits with existing or new general APIs. Which you're already doing with HTML API
The neat trick with flushing the output buffer is that it’s 100% compliant with existing pause-the-world-until-it’s-done solutions. The only difference is that the client uses line-buffering on the progress event to partially decode the JSON.
While not deployed (for other reasons), this is something I worked into the bell notifications on WordPress.com. It required only a little finagling on the client side, and while line-delimited JSON would have helped, it was not necessary.
If you have any resources for optimizing/rendering large data trees on the client, please share
That was my intent linking to the comments-tree. It was the reliance on React to lazy-load the actual content which led to implicit optimization, because no data was pulled which wasn’t necessary.
The initial load of the structural information (the ids with their hierarchy) was small enough to get the UI skeleton rendered, and with a single page, this wasn’t much at all. Then, whichever categories are visible can declaratively load the actual category information like slug, title, etc… Would leave it to a small abstraction to batch those requests into “paged” requests (for example, with a debounce of 50ms, gather all requested IDs and transform it into a single API call).
As for the fact that we have a tree/list of 10,000 items that’s more in the domain of things like the older Virtualized List components. Still, if we have the structural hierarchy, have you considered a filterable list like a datalist component would provide? For any matching tags we can show that lineage of the tree both up and down. Strike some balance between showing too many categories through which to scroll and find the right one and showing no context when you find one.
Activity
designsimply commentedon Sep 26, 2018
I will work on a way to generate several thousand tags for testing, and this is exactly the kind of issue that opt-in testing helps uncover. I appreciate that you have reported this!
tecnogaming commentedon Sep 26, 2018
Thanks so much for your reply. Yes, it does seem like Gutenberg is not designed for big blogs as having tons of categories and tags makes it almost impossible to handle. There must be something wrong on the way Gutenberg ask for that information.
danielbachhuber commentedon Sep 27, 2018
WP-CLI is pretty helpful for this:
#6694 is potentially related. However, it would be useful to track down whether the source of your slowness is: 1) purely from the amount of data, or 2) caused by some plugin or your theme causing slowness (in addition to the amount of data).
tecnogaming commentedon Sep 29, 2018
websupporter commentedon Nov 16, 2018
I think the problem is related to the following:
The current implementation does not use the state management system due to #11643. Currently, this results in a lot of API Requests instead which slows down the whole process.
tecnogaming commentedon Nov 16, 2018
Widhy980 commentedon Dec 10, 2018
I also have the same problem, sometimes I type a lot of tags and immediately disappear and re-write again. then I tried to wait for the autocomplete and sometimes it suddenly disappeared. is it possible to use same system on classic editor?.
I have 8.147 Tags on my WordPress.
ActionCoding commentedon Feb 12, 2019
I am also having the same issue when entering tags. Sometimes it is using so much memory it slows my system to a hault. Is there any way to use the old system for tags where it saves them when you click to update the post instead of when you are typing them in?
MartinHlavna commentedon Mar 30, 2019
Same issue here, on smaller scale.
Loadnig of 50 categories takes about 3-4 seconds, which is kinda usable.
Hower typing tags (3023 at the time of writing) is real problem. If I type multipe tags at once they dissappear. Selecting tag from search results kinda helps, but loading takes more than 10 seconds.
SuzuKube commentedon Apr 2, 2019
Same problem :/ ! On the tags ^^'
designsimply commentedon Apr 16, 2019
I think it helps for new people commenting to mention the total number of tags they have on their site. Thank you to those who have commented so far.
psokolovs commentedon Apr 28, 2019
I have a few thousand tags, and this is a serious issue for me. Especially because my server is pretty slow, so each API call is about a 1 second response time. It's basically paginating non-stop.
oxyc commentedon Apr 30, 2019
A quick hack I use for a taxonomy called
postal_codeso it returns up to 100000 terms per request:source: https://github.com/WordPress/gutenberg/pull/10762/files#diff-d0c65e7ac505d44d8571ddaffc510d98L412
36 remaining items
jhmonroe commentedon Jul 31, 2024
Seconding all of this and confirming that if I deactivate Rest API for certain post types, the Category/Tag AREAS load instantly in Classic editor. Have noticed similar issues where Featured Image, Category, and Tag areas all loads last in the WP Admin sidebar. Often 10-20 secs after the rest of the admin, content of the post, etc is all loaded. It seems to be something with Rest API and the order in which the admin loads.
In the video I posted here, you can see Categories and Tags loading way after (and also note that before they load, they do not show up as an option in Preferences
#55460 (comment) (< video is comment on this post)
The site overall has 18 categories and 28 tags for normal posts. Even in a CPT with 3 categories, this slow loading occurs. So really not the numbers that are the source of some of the delays mentioned above.
In the attached screenshot, you can see it's one of the last things to load on the page and takes many MS.

Although this is a "backend" issue, it really is front-facing in the sense that our clients see this. Ultimately it affects the entire ecosystem of designers, developers, etc who evangelize custom Wordpress sites to clients as a great product overall but a bug like this makes the client think Wordpress is hard to use when things don't appear sometimes or take a long time to appear.
swissspidy commentedon Jul 31, 2024
The REST API requests themselves are quite fast on my local site. If they are slow for you, I'd suggest looking into profiling those requests with XHProf.
From what I read in this issue and see in my own testing, the main problem is that the editor only renders the categories panel after paginating through all the categories, which is slow if you have hundreds of those. And there's not even a spinner or anything. #29393 would solve this (and yes, maybe it can be solved as part of #61852). So I'd recommend focusing on that part first and foremost.
FWIW I second this. The Gutenberg team is fare more experienced with the editor architecture and React performance best practices. It doesn't make sense for the core performance team to "take over", but of course we can help where possible.
Mamaduka commentedon Aug 27, 2025
I think the remaining issue here is with hierarchical taxonomies, such as categories, where the editor must make unbound requests (
perPage: -1) and wait until all responses are returned before rendering any content. This was confirmed in recent tests by @supernovia.Considering some recent improvements to the data layer, I think I've some ideas how to fix this. A good start would be to display intermediate results, along with a loading indicator in the right places, to communicate that data fetching hasn't finished yet.
I'm going to assign the issue to myself and will try to PR for the proposed solution.
jhmonroe commentedon Aug 27, 2025
@Mamaduka visual feedback for the user experience and intermediate results would really help! Very good idea.
Curious how you think "intermediate results" might be handled.
One approach might be that if a site only has, say, 10–12 or less categories, it simply outputs them as checkboxes (like Classic).
If there are more than 10, it proceeds with the new method. I guess these are what we might call Conditionals?
Jetpack's slideshow has conditionals this way... when there are less than X images, it displays dot indicators for the # of slides. If there are more than X, it shows "X of XX"
These types of approaches sort of follow what's called PROGRESSIVE DISCLOSURE, where the user experience is improved by only showing users what they need at any given moment. And not showing too much or having a complicated solution when it's not warranted.
Mamaduka commentedon Aug 28, 2025
It will try to build the "tree" with the first 100 results and display a loading indicator. Unfortunately, the current design/structure requires fetching all categories to build the UI, so we're limited in how much "progressive disclosure" or "virtualizing" techniques can be applied.
dmsnell commentedon Aug 31, 2025
@Mamaduka we did some related work in Calypso for building comment management, where some sites and even some posts had thousands of comments in a big tree, and the tree was not chronological either (some very old comments would get very new responses).
we built a new API to power this which provided a trimmed-down tree of the hierarchical comments which is then used to quickly render the UI structure while the UI lazy-loads the content. this is how we were able to get the pagination working without loading all of the comment data, and then have the first page loaded fast and first.
you can see it at the Developer Console for wordpress.com. You can enter
/sites/mysite.mydomain/comments-treeto see it for any site you may have there.in some experimentation I found more-optimized ways of sending this rather than as a JSON data structure which cut the size down substantially, and grabbing all of the data from the database was optimized as well.
if you think this is of use here I’d be happy to expand on it. it doesn’t look like the general-purpose API endpoints but it was built to power a UI panel that could not wait until 10,000 comments loaded from the normal one. in fact though, this is how we build effective, simple, and performant APIs rather than re-exporting the database through generic CRUD interfaces, but that’s a story for another time.
Mamaduka commentedon Sep 2, 2025
@dmsnell, thanks for sharing a great example. I think we will eventually need similar sub-endpoints to represent hierarchical data in various places, such as Panels and DataViews. IIRC, @oandregal worked on something related for the post types, though it also had some performance implications. Ref: #66479 (comment).
My current solution is somewhat naive and uses a recent experimental feature to render results as they're received from the server - #71402.
dmsnell commentedon Sep 3, 2025
I couldn’t tell from the linked comment what was causing the performance issues, whether it was the API fetch or the UI rendering.
One note about what we built with the
comments-tree— we abandonedWP_Query(). Now I don’t know if that’s relevant here because when we built that I wasn’t aware that we could add'fields' => 'id=>parent`` and get the parent and child ids. Still, it’s an avenue to consider because I vaguely remember hitting performance-relevant issues withWP_Query` vs. a raw SQL query.Hm. Nice. That was an inevitable need given the way the data fetching assumes requests start and end and give no introspection to that process.
Another thing I experimented with was sending HTTP chunked data, or of simpler mechanisms to flush the output buffer while building a request.
The thing with the
comments-treewas that it was fast enough and small enough to send in its entirety to the browser, which let the UI instantly render as it wanted, even with blanked-out data (spinners or skeletons instead of tag names, etc…). Then normal fetching and caching kicked in and the data appeared progressively by nature, not by code.While it appears like
RECEIVE_INTERMEDIATE_RESULTSmight work on pagination, if we use chunked encoding or buffer-flushing we actually want to use JS’s progressEvent to track the download. This also requires using something like a partial JSON parser, or LD+JSON. But, it’s a simple method to start getting content from the server to the UI much much faster.Mamaduka commentedon Sep 3, 2025
Right, there's not a lot you can derive from core data resolution statuses, but it works for most of our current cases.
You can also use
currentItemsandtotalExpectedItemsstate withRECEIVE_INTERMEDIATE_RESULTSflag to display more interactive loading states. I tried that initially, but it was decided to use the spinner instead.I've used server-sent events in the past for some client project, and it was a project I really enjoyed.
Shipping similar specialized endpoints seems to go against WP philosophy, but it would be great to see how far we can push the limits with existing or new general APIs. Which you're already doing with HTML API 🦸
P.S. If you have any resources for optimizing/rendering large data trees on the client, please share 😄
Screenshot
CleanShot.2025-09-03.at.17.55.34.mp4
dmsnell commentedon Sep 3, 2025
The neat trick with flushing the output buffer is that it’s 100% compliant with existing pause-the-world-until-it’s-done solutions. The only difference is that the client uses line-buffering on the progress event to partially decode the JSON.
While not deployed (for other reasons), this is something I worked into the bell notifications on WordPress.com. It required only a little finagling on the client side, and while line-delimited JSON would have helped, it was not necessary.
That was my intent linking to the comments-tree. It was the reliance on React to lazy-load the actual content which led to implicit optimization, because no data was pulled which wasn’t necessary.
The initial load of the structural information (the ids with their hierarchy) was small enough to get the UI skeleton rendered, and with a single page, this wasn’t much at all. Then, whichever categories are visible can declaratively load the actual category information like slug, title, etc… Would leave it to a small abstraction to batch those requests into “paged” requests (for example, with a debounce of 50ms, gather all requested IDs and transform it into a single API call).
As for the fact that we have a tree/list of 10,000 items that’s more in the domain of things like the older Virtualized List components. Still, if we have the structural hierarchy, have you considered a filterable list like a datalist component would provide? For any matching tags we can show that lineage of the tree both up and down. Strike some balance between showing too many categories through which to scroll and find the right one and showing no context when you find one.