Content

Batch processing in Joomla: change two hundred articles without opening one

Batch processing in Joomla: change two hundred articles without opening one

The Batch button in Joomla's Article Manager moves, copies, tags and re-permissions many articles at once. What each option does and what Move breaks.

Sooner or later every Joomla site needs the same change on a lot of articles at once. A category gets split in two, a tag has to go on forty old posts, or a set of pages must become visible to registered users only. Opening each article, changing one field and saving it again works for five items. For two hundred it is an afternoon lost, and a good way to miss a few.

The Article Manager has a tool for this that many site owners never notice: Batch. It sits in the Actions dropdown in the toolbar and only becomes active once you tick one or more articles.

What Batch can change

Select articles, open Actions → Batch, and a dialog offers these fields:

  • Set Language: gives all selected articles the same content language.
  • Add Tag: adds one existing tag to every selected article. Tags the articles already have stay where they are.
  • Set Access Level: Public, Registered, Special, Guest, or any custom level you created.
  • Set Workflow Stage: only shown when workflows are switched on for articles.
  • Copy or Move to category: pick a target category, then choose Copy or Move.

Leave a field on its default ("Keep original ...") and Batch does not touch that property. You can combine several changes in one run, for example move to a new category and set the access level at the same time.

Selecting more than one page of articles

Batch only acts on the boxes you ticked, and you can only tick what is on screen. With the default list limit of 20 that means 20 articles per run. Filter the list first (by category, tag, author or a search term), then set the list limit at the bottom to All, and use the checkbox in the column header to select everything that matches. Check the counter before you press Process. A filter that is too wide is the most common way to move articles you did not mean to move.

Copy is not the same as duplicate

Copy creates new articles with new IDs. A few things behave differently from what people expect:

  • Copies are saved unpublished, so nothing new appears on the front end until you publish it.
  • Copying into the same category changes the title and alias, giving you "My article (2)" with alias my-article-2. Copying into another category keeps the title if the alias is free there.
  • The hit counter of the copy starts at zero.
  • Language associations do not come along. A copy is a standalone article.

Copy is useful when you want a starting point for a new section. If you only want articles to show up in two places, a copy is the wrong tool: you will have to keep both versions up to date by hand. Use a tag, a featured flag or a module instead.

Move changes your URLs

With search engine friendly URLs on, the category is usually part of the article address. Moving an article from /news to /archive changes its URL, and every link that search engines, newsletters and other sites have to the old address now ends in a 404. Joomla does not create redirects for you when you batch move.

Before a large move, export or copy the current list of URLs (a sitemap or a crawl is fine). After the move, set up redirects from old to new. How to do that with the built-in tools is described in Fixing broken links with Joomla's Redirect component. Also check menu items that point directly at a single article: they keep working, because they use the article ID, but a menu item of type "Category Blog" for the old category now shows fewer articles or none.

Permissions decide what Batch is allowed to do

Batch respects ACL. To move articles a user needs edit permission on the articles and create permission in the target category. If someone reports that Batch "does nothing" or that only some articles moved, look at the message at the top of the screen: Joomla skips items the user may not change and says so. Fixing that in Content → Categories → Permissions is better than letting a Super User run every batch job.

Things Batch does not do

  • Older Joomla versions can only add a tag in Batch. Newer releases also offer a Remove Tag option. If yours does not, unpublish the tag in Components → Tags or edit the articles one by one.
  • It does not change author, publish dates, featured status or custom field values. Featured and published state have their own toolbar buttons, which also work on a selection.
  • It has no undo. Every article does get a new entry in its version history if versions are enabled, so a single article can be restored, but there is no button that reverses the whole run.

A safe routine for big batch jobs

  1. Make a backup of the database. Batch writes directly to the articles table.
  2. Filter the list until it shows exactly the articles you want, and write down the count.
  3. Run Batch on a small test selection of two or three articles and check them on the front end.
  4. Run the full selection and compare the count in the success message with the number you wrote down.
  5. For moves: add redirects and clear the cache, so visitors do not get old category pages.

The same Batch button exists in the managers for categories, contacts, menu items, modules and users, with options that fit each component. Once you know it in the Article Manager, you will find a use for it everywhere else in the backend.

Stuck on something else?

Doctor Joomla is a project of Cloudfaction, a Dutch agency building and maintaining Joomla sites since 1999. The articles are made with the help of AI, so tell us if something does not match your screen. Mail info@cloudfaction.nl if you want someone to look at yours.

Rather have someone look at it

Doctor Joomla is a Cloudfaction project.

A Dutch agency that has been building and running Joomla sites since 1999. If your site needs more than an article can fix, get in touch.