[Wordpress Node] Is this a bug or a setting issue?

I am trying to use the POST to WordPress node and I want to use some tags, that 100% exist on my WordPress site. However, when trying to add them in, it only checks against the first 10 in the database
image

I have also clicked on the “Refresh List” and it does it, but still the same issue so any tags after these don’t seem to be accepted.

Is this a bug or am I missing something?

I suspect it is a mix of a bug and a missing implementation, By default wordpress only returns 10 items unless you use the limit option (API Doc: Tags | REST API Handbook | WordPress Developer Resources)

As a test if you load https://your-site.com/wp-json/wp/v2/tags you will probably only get 10 items back but if you add ?per_page=20 to the end you will get 20.

Looking at the Wordpress.node.ts it is just using /tags, In theory it is a fairly quick change to implement the return count.

This won’t solve your issue but at least you know where the problem is.

indeed this seems to be the case

I am sure @RicardoE105 will be all over it but if he doesn’t get to it I can probably pop in a pull request with the change in it later this week.

Unless you fancy doing it :slightly_smiling_face:

3 Likes

please do, would be much appreciated :wink: thanks.

@RedPacketSec I was just having a look at this one and it looks like all the calls that use wordpressApiRequestAllItems fail (Get all Users, All Posts that sort of thing).

Are you able to confirm you are seeing the same issue with everything?

I’m afk but will get back to you and check.

I’ve moved some of my queries over to a HTTP node as I have more control. Over that

Just had a look and that is weird. When using wordpressApiRequestAllItems it should paginate automatically. The only thing that comes to mind it’s that that particular endpoint has a different method for pagination which I highly doubt.

@RedPacketSec You can always set tags manually using expressions using the tag id, check the image below. I think you can get the tag id from the Wordpress admin dashboard.

1 Like

@RicardoE105 from why I could see the while condition on the header check is always false, swapping it to != fixes a lot of them but not tags. Will carry on poking when I get home, just popped out for some lunch.

Ohh gotcha, then it must be returning 10 items in all retrieve operations. Thanks for checking that out.

Pull request is in and can be found here: https://github.com/n8n-io/n8n/pull/2097. It appears to be working on a test site but more testing may be needed.

2 Likes

Just had a look, the only thing i have over 10 items, when choosing from the drop down options in the POST item really is the tags, the rest of it is lower that that

No worries, I did a test on a site that had over 10 posts and users just to make sure it was now working. In theory it is fixed but it will need to go through the review process before being added but if you are running from source you could apply the changes in the pull request and you should be good to go.

1 Like

im running from docker

my site has literally thousands and thousands of posts, just 1 user, 5 or 6 categories etc.

@RedPacketSec looks like this should be fixed in 0.137.0 although with thousands of articles it is going to take a while to fetch them all.

2 Likes

Improving the Server Resources will speed up this? Or It’ll take the same time bro?

How would it work e.g

List all from a -z

Start listing when you start typing

E.g
articl

As in article

and then it pulls back all with that starting phrase?

It basically loops through the pages and returns them in the order Wordpress gives them.

@mcnaveen i guess if you increased the spec of the Wordpress server it might be quicker the api in Wordpress isn’t the quickest when the database gets larger.

Sometimes it is quicker to just query the database directly.

1 Like