Skip to main content
info@drupalodyssey.com
Thursday, June 5, 2025
Contact

Main navigation

  • Home
  • Blog
    • all
    • Development
    • Community
    • Management
    Aluminum Cans Passing Through the Assembly Line by cottonbro studio on Pexels
    Automate and Simplify Your Drupal Workflow with Bash Scripts for Shared Hosting
    Jul 19, 2024
    Binoculars resting on newspapers.
    Evaluating Search and Replace Scanner: The Ultimate Tool for Drupal Bulk Content Edits?
    Jun 29, 2024
    People looking at a computer screen
    S3 File System Module Not Working with Media Entity Download Module? Here's the Fix
    Jun 18, 2024
    Mechanic hands working on an engine.
    Setting Up the Etsy OAuth2 Client For Use With The Etsy Shop Integration Module
    May 10, 2024
    Fashion designer sketching new garments.
    Crafting Your Online Store: Drupal's Role in Your Etsy Success
    May 09, 2024
    Socket toolbox
    Beginner's Guide: Getting Started With Drush for Efficient Drupal Development
    May 08, 2024
    Stargazing over mountians.
    Drupal-Powered Stargazing: A Module for NASA's Astronomy Picture of the Day
    Sep 15, 2023
    Computer screen with code.
    Learn How To Script Drupal Installations Using Drush
    Dec 08, 2014
    Scuba diver with Drupal mask.
    Scuba: Drupal Style
    Oct 16, 2014
    Woman frustrated with laptop.
    5 Reasons Your CMS Sucks
    Jul 24, 2013
    Two young men having a discussion in front of a computer.
    Deployment Module XSRF Patch Committed
    Jul 05, 2013
    Two young men having a discussion in front of a computer.
    Deployment Module XSRF Patch Committed
    Jul 05, 2013
    Application settings.
    Using PHP To Disable Internet Explorer Compatibility Mode
    Jun 04, 2013
  • Resources
  • About
  • SPACER
  • SPACER
  • SPACER
  • SPACER
  • SPACER
Search
Management

Evaluating Search and Replace Scanner: The Ultimate Tool for Drupal Bulk Content Edits?

June 29, 2024

Drupal Odyssey is supported by it's readers. When you purchase products or services using the links on this site, we may earn a small commission at no additional cost to you. Learn more

It's 11:30 on a Friday morning and your manager sends you the following email.

John,
Legal has received the approved registered trademark paperwork for our Imaginary Program™
from the U.S. Patent Office. They have asked that all instances of the trademark symbol be
replaced with the registered trademark symbol [ ® ] across the entire site before the end of
the day.

I appreciate your prompt attention to this before the weekend.

--Beth

Bethany Clayton
Content Coordinator/Editor
Imaginary Company
http://www.imaginarycompany.io
(555) 555-5555

Wonderful! Our site has over 200 pages of content, not including image, pdf and video files, where this one freaking character could possibly be!

There's A Module For That

I recently ran into a similar scenario with a client, albeit, not this extreme in terms of timelines. I needed a solution that was easy to use and reliable. "Surely a tool exists already for this.", I said. I did a quick Google search for "drupal search and replace" and the first result was the Search and Replace Scanner module. Hmmmm … I'll give it a try.

What's In The Box

There's not much documentation for the module online, but I was able to get it installed and figure out how to configure it to get it "working" using the README file. I was surprised that in addition to Node entities, it also supported Paragraph entities out of the box. This was a major happy moment because the site I was working on used Paragraphs heavily.

After configuring the module, I ran a test scan and replacement on the site. It found 96 references of the trademark symbol in different fields on 68 different node and paragraph entities. Sweet!

But We're Missing Some Parts

I started browsing the site looking in places where I knew the trademark symbol was. {sigh} It didn't work. This is because the site uses Page Builder and has several custom blocks created with the core Block Content module. So I started looking through the source code and sure enough, there were plugins for Node and Paragraph entity types, but not the BlockContent entity type.

Fabricating A New Plugin

I was able to copy the Node plugin to a new BlockContent plugin and make some quick and dirty modifications where needed and got a functional BlockContent plugin. Then I reconfigured the module to account for the custom blocks and ran the scan and replacement again. It found an additional 36 references on 24 custom blocks. However, when examining the same previous pages as before, some of the trademark symbols had been replaced, but others were not. {fml}

I did some more searching and found an open issue that could be potentially causing the problem. Some of the custom blocks have Paragraphs (and sometimes nested Paragraphs). I'm currently working to help solve this issue and once I get my head wrapped around it, will post any code updates to the issue queue.

Other Content Entity Support

Not related to what I needed, but while looking at the source code, I noticed that the Term entity type did not have a plugin either. While it may be less common use case for taxonomy terms, they are used heavily and could contain content that needs to be replaced. In my mind, all of the basic core content entity types should have a plugin in the module code (i.e. Node, Term, BlockContent, Media, etc.). I may open some new feature request issues for these new plugins soon … at least the BlockContent plugin since I already have a working solution.

The Verdict?

While working with this module for a few hours, I can see its usefulness in the Drupal community. If you are not using the more advanced features of Drupal 9 and 10 and just use basic node fields and some paragraphs here and there, then this absolutely will work for the task. If you are using the more advanced features of Drupal, you'll need to find another tool or get involved with the project and contribute the missing pieces back to the community.

Have you used the Search and Replace Scanner module on a project successfully or implemented plugins for other content entity types? I'd love to hear your thoughts or comments on the module.

Author

Ron Ferguson

Previous Blog

Next Blog

0 Comments

Login or Register to post comments.

Categories

Categories

  • Development
    (8)
  • Community
    (9)
  • Management
    (3)

Trending Blog

Trending Blog

Woman frustrated with laptop.
5 Reasons Your CMS Sucks
24 Jul, 2013
Mechanic hands working on an engine.
Setting Up the Etsy OAuth2 Client For Use With The Etsy Shop Integration Module
10 May, 2024
Stargazing over mountians.
Drupal-Powered Stargazing: A Module for NASA's Astronomy Picture of the Day
15 Sep, 2023
People looking at a computer screen
S3 File System Module Not Working with Media Entity Download Module? Here's the Fix
18 Jun, 2024
Computer screen with code.
Learn How To Script Drupal Installations Using Drush
08 Dec, 2014

Tags

Tags

  • Drupal 10
  • Drupal 9
  • Drupal 8
  • Drupal 7
  • Drush

Ad - Sidebar (300 x 250 AD)

Ad - Sidebar (300 x 600 AD)

Newsletter

Subscribe my Newsletter for new blog & tips Let’s stay updated!

Categories

  • Development
  • Community
  • Management

Useful Links

  • About
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Disclaimer
  • Cookies

Must Read

Aluminum Cans Passing Through the Assembly Line by cottonbro studio on Pexels
Automate and Simplify Your Drupal Workflow with Bash Scripts for Shared Hosting
19 Jul, 2024
Binoculars resting on newspapers.
Evaluating Search and Replace Scanner: The Ultimate Tool for Drupal Bulk Content Edits?
29 Jun, 2024
Mechanic hands working on an engine.
Setting Up the Etsy OAuth2 Client For Use With The Etsy Shop Integration Module
10 May, 2024
Socket toolbox
Beginner's Guide: Getting Started With Drush for Efficient Drupal Development
08 May, 2024

© 2024 All Rights Reserved.

Proud supporter of active military, veterans and first responders.