Iterate Wordpress page for translation with API

Hello

I’ve created a workflow that connects to my Wordpress site via WP’s API rest, retrieves all the published pages from my site and translates them with Deepl, then creates the new translated pages on Wordpress and finally associates all the translations with each other. The workflow manages Wordpress pagination, as we’re limited to 100 pages per request on WP, even though I only have 34 pages here.

In my current workflow, I’ve defined 4 languages for translations. The workflow works, but only because the translation is done on a single page.

I have 34 pages that I’d like to translate automatically. But I don’t understand why it doesn’t work. Where did I go wrong? I think the problem is in nodes 4 and 5.

So the workflow works, but only translates one page, even though I’ve set dynamic elements.

I need your help. ChatGPT and Claude haven’t been able to help me.

Here’s the workflow.

Thanks in advance

Information on your n8n setup

  • **n8n version: 1.53.1
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

i always use {{ $runindex +1 }} for page value in WP node and then use it in loop.

it will iterate all pages.

something like this

When using the Loop over Items node, you need to connect your last node in the loop back to the loop node - similar to what you did with the code node.

Thanks for answer but I don’t understand. If you show the workflow, I already use nodes for the pagination. I try to add what you said but because I don’t know what to do. I have to remove some nodes after adding your parameters ? How iterate it with the loop element ?

Thanks in advance

Hello

Thanks for your answer but I try this many time and that didn’t work. Bellow the link video who I record my laptop screen to see the workflow execution. You can see that different items are send beetween nodes.

Here a streenshot that show the resultat after executing the workflow

Here below the video of my screen to see what happen when I lunch the workflow
https://drive.google.com/file/d/1tpLDSFG2vtMV_2YU3tRQpqFZ_6ApMczq/view?usp=sharing

Thanks in advance

Ah you didn’t have that bottom connector in your original workflow :slight_smile: Loops within loops are always a bit tricky. My first impression is that the last node should loop back to your second loop node. Then, connect the ‘done’ output from the second loop node back to the first loop node.

something wrong with the loop

main issue is to add edit node at the end with empty ouptput and execute once. so that you end the loop with one item.

also not sure what this does. but there should be only one item to return to loop

this loop is not looping

![loopddddd|690x334](upload://5WiQoDgPS1A7wakN1fd4L3f82IM.png)

Hello

Thanks you for your time. Have you watch the link video I share ?

Here what the loops nodes does :grinning:

First LOOP :
3- Iterate through Retrieved Pages (SplitInBatches Node)
Loop to process each page individually.

4- Identify Remaining Target Languages (Code Node)

  • Detect languages already translated for a page.
  • Generate a list of remaining target languages.

2nd LOOP :
5- Iterate through Remaining Target Languages (SplitInBatches Node)
Loop through each remaining target language.

Hello

Did you watch the link video I share ? I try what you mean but nothing happen

For those who want to help me live, I’ve created an online n8n test instance and a dedicated wordpress site. Here are the login details so you can log in and see my workflow directly and test it. It’ll be easier, I think.

Test n8n login:
Email and login: [email protected]
Password: Loki88EER-Rd52

Test wordpress login:
Login: n8n-support
Password: ThisL-opera0057

Don’t worry about security, these are test environment sites.

Thanks in advance for your help
@Edmunds_Priede @bartv

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.