I just created my first batch using batch API and it seems to work!

The progression bar is properly displayed during the execution and it uses administration theme, Seven for my site, which I guess is the standard behavior.

Is there a way to use the default theme of my site instead?
How do I do that?

  • Does this answer your question? How do I change a theme based on the URL?
    – leymannx
    Commented Feb 3, 2021 at 17:20
  • Ah sorry, Drupal 8. drupal.stackexchange.com/q/201530/15055. I find a lot of blog posts on that as well. Google for "Drupal 8 switch theme on route" or something like that. Because for your batch process you created a route with a form, right? Then on that route switch the theme. This has nothing to do with batch processing.
    – leymannx
    Commented Feb 3, 2021 at 17:22

1 Answer 1


In fact, my question was irrelevant.
It appears that I ran my tests of my batch using a user with administrator role. Hence the theme (Seven) used during the execution.
I checked that using another user (not being an administrator) and it was the default theme of my site that was used.

By the way, I got the opportunity of some interesting readings. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.