-

How to Mass Edit Products In Drupal? With Views Bulk Operations and API

Managing many products on a website can be difficult and time-consuming, especially when data changes frequently, and business partners need quick access to up-to-date information. Drupal offers solutions that significantly simplify these processes. In the following blog post, I’ll show how to prepare a convenient admin panel in this system for editing multiple products simultaneously. I encourage you to read the article or watch an episode of the “Nowoczesny Drupal” series.

Challenges in managing a large number of products

Manufacturing companies often have hundreds or even thousands of products. Managing such an assortment requires the right tools to do so:

  • quickly search and edit data,
  • group updates of product parameters,
  • automatic sharing of information with business partners.

Manually managing products on a manufacturing website would be highly time-consuming and error-prone. Drupal allows you to automate many processes, significantly streamlining working with large data sets.

Editing many products at once in Drupal

Product management in Drupal makes the website administrator's job easier and provides contractors with automatic access to always up-to-date product information. This blog post presents solutions for a hypothetical company producing internal combustion engines for boats.

In an article on how to create a website for the manufacturing industry, I showed how to build a basic page structure in Drupal. We added "power" and "capacity" fields, among others, and views presenting a list of products. Now, we'll go a step further, configuring modules and features that will streamline the management of a large product catalog and enable easy integration via API.

What modules will you need?

For this solution, we add the following modules to Drupal:

  • Views Bulk Operations - it allows bulk operations on multiple objects (e.g., editing fields).
  • Views Bulk Edit - depending on the version of Drupal, sometimes additional packages of this module are required.
  • Restful (RESTful Web Services) - is a module available in Drupal's core, which we’ll use to expose data in JSON format.

The first two modules you can download from the Drupal.org website, while the third is already built into Drupal. For this article, we assume that all modules are installed and active.

Extending the administration panel - editing multiple products simultaneously

On our website, in the admin panel, we have a view that displays all products (engines). In this view, you can search by various parameters, such as title, power, and capacity. Based on this data, we’ll prepare an admin view in Drupal.

Step 1: Prepare the administrative view

  1. In the admin panel, we create (or edit) a view displaying all products (e.g., engines).
  2. We add filters according to selected parameters, such as title, power, and capacity.
  3. With filters, you can easily narrow down the number of items displayed, which is very convenient when you have hundreds or thousands of products.
A screenshot presenting the engines on a sample manufacturing company website on Drupal.

 

Step 2: Add Views Bulk Operations (VBO) column

  1. In view editing, change the view format to Views Bulk Operations.
  2. Where previously we had, for example, a table with a list of products, we’ll now be able to select multiple rows at once.
  3. It’s best to move the checkbox column to the start and ensure the column name is clear (for example, "Edit").
Views Bulk Operations setup screen in Drupal for bulk product editing.

 

Step 3: Configure mass actions

In the VBO settings in the "Actions" section, we choose which mass operations will be available.

Examples of actions include:

  • Modify field values (change field values, e.g., capacity from 1200 to 1500 in multiple products at once),
  • Withhold publication (withdraw the product from public view),
  • Generate CSV from selected view (export data to Excel, for example),
  • Delete content (deleting outdated products).

Views Bulk Edit (VBE) can additionally allow you to edit content either directly in a table or in a simplified form. Note that sometimes additional modules may be required for VBE to work.

Configuring bulk actions for products on a manufacturing website on Drupal with Views Bulk Operations.

 

Example of mass product editing using "Highway Star"

For instance, we have products with "Highway Star" engines. I’ll show you how to edit these products in bulk. If you want all products whose name contains "Highway Star" to have the same capacity, just follow a few simple steps:

  1. Enter "Highway Star" in the filter,
  2. Select the displayed products,
  3. Select the "Modify field values" action,
  4. Enter a new value (e.g., capacity = 2000),
  5. Approve and save the changes.

In seconds, we will change one property for many products at once without editing each item individually.

"Highway Star" engine listing on a sample manufacturing company page on Drupal.

 

We can do the same with engine power or any other field we added to the product.

Applying Views Bulk Operations in a broader context

With Views Bulk Operations, you can collectively manage very different data, such as:

  • Product availability (e.g., by updating the "Available"/"Unavailable" status),
  • Categories and tags (assigning multiple products to a new category),
  • Numerical parameters such as power, capacity, dimensions, etc.

If we configure filters in the view, we can first precisely select a group of products (e.g., based on SKUs, categories, and date range of entry) and then select all of them and set the chosen bulk action. 

If you have a very large number of products (hundreds or thousands), Drupal can take care of bulk processing, which allows you to effectively update many entries in one go.

Export product data using API

Increasingly, companies expect to exchange product information directly between systems - without manually uploading Excel or PDF files. We have such an opportunity when we use Drupal and apply the API.

The main benefits of using the API:

  • Always up-to-date on specifications, availability, or prices.
  • Saving time by eliminating manual data entry.
  • Less risk of errors and automation of processes on the part of partners.

Imagine a situation where our trading partner needs the latest information on engine capacity, availability, or horsepower daily. Without the API, we’d have to generate and send a new version of the file each time, and the partner would manually update their system. The API solves this problem: all our partner needs to do is download the data from under a specific path (e.g., /export), and they always have an up-to-date list of products.
 

An example of exporting bulk amounts of data from Drupal using RESTful Web Services.


For our example, I created a very simple API that shows only four pieces of data:

  • product name,
  • power,
  • capacity,
  • link to technical specifications and link to photo.

Step 1: Enable the REST service

  1. In Drupal 8/9/10, we enable the RESTful Web Services module in the "Extensions" (Module) section.
  2. We make sure that the JSON format is available (it’s usually enabled by default).

Step 2: Create a new view of type "REST export"

  1. We create or clone an existing view displaying our products.
  2. We add a new display of the REST export type.
  3. We set a path, such as /export, under which Drupal will make the data available.

Step 3: Select the fields for the API

It's a good idea to opt out of displaying the whole entity (the "Entity" option), as this could contain unnecessary information (like publication date or author). Instead, choose the Fields format and indicate specific fields, such as:

  • Product title (e.g., engine name),
  • Power,
  • Capacity,
  • Link to a PDF file (e.g., technical specifications),
  • Link to the image (so contractors can display the graphic at their place).

Step 4: Relationships for files and images

We add media or file links in the Relationships section if we need full file paths.

A screen with a view of the Drupal settings for creating a link for files and images in products.

 

This will ensure that the correct links (URLs) appear in JSON format.

Step 5: Verify endpoint operation

After saving the view, all we need to do is go under the /export path (or any other set path). There we’ll see our product data in JSON format.

A view of verifying the performance of the created endpoint after issuing data from the API in Drupal.


This allows us to check that product information is displayed correctly, and business partners can download the updated product list automatically - even every hour.

Mass product editing with Views Bulk Operations and APIs - summary

In Drupal, we can easily create an interface for managing many products using the Views Bulk Operations module (and possibly Views Bulk Edit if we need more advanced editing options). This way, the administrator doesn't need to perform each update separately - just select the necessary products and change the selected attribute.

The REST export option, in turn, makes it possible to quickly expose data in JSON format. This allows our contractors or business partners to automatically download up-to-date product information (e.g., specifications, availability, or prices), significantly saving time and minimizing errors.

This solution works especially well for companies that offer a wide range of products. By combining mass editing with automatic data sharing, they can increase work efficiency and simplify daily product management. If you need support with advanced website configuration or Drupal settings, check out our web development service for manufacturing. 

.