For a one-time “patch” to update your database for word replacement, I find that this tool from interconnectit.com is excellent. Be sure to have a backup of your database first, just in case.
An alternative would be to write a plugin that pulls the content from each post, does the filter, then updates the post by saving it back to the database. Your code is only filtering the content when it is being displayed, you are missing the steps of actually modifying the content and saving it again.
The DB-level word replacement routine is much more efficient, especially if this is a one-time event. The tool will allow you to target specific tables, so you don’t inadvertently change text in other than the _posts
table.
Related Posts:
- Add multiple custom fields to the general settings page
- When should you, and when should you not, use wp_list_pluck()?
- Display random categories on the front page (Finding and Editing Theme Functions)
- Is it possible to remove the “standard” post format?
- Woocommerce add to simple product attribute programmatically [closed]
- Issue with get_theme_mod returning a blank value instead of the saved value
- How to remove row-actions from pages table?
- opening links in new tab using – add_filter( ‘the_content’, ‘make_clickable’);
- Modify search function in WordPress (TwentyTwelve)
- Auto delete WordPress images/thumbnails (all sizes) and featured after X days/hours, or similar?
- How to fix a theme with page.php Default Template that accidentally deleted?
- Set default options for inserting media
- Remove tag on my RSS Feed
- How do I change parameters without changing the core
- Problem with extract() with custom shortcode
- add sidebar area to header of child theme
- Theme-Config tab in admin Pannel?
- Creating loop within functions.php
- How to Add a Random Custom Gravatar in the WordPress Comments?
- Delete pages and Create default pages for all new network sites
- Actions according to image type and size
- Post thumbnail relative link and HTML modify
- adding custom classes for tables
- Pass Shortcode Attribute to footer Script
- How to mass-delete inline styles in WordPress custom post type automatically?
- Remove the deleted users avatar from list
- How to call custom function from functions.php in site-wide template files?
- PHP files included in functions.php don’t seem to work
- How Can I Expand the WordPress Customize window without any Plugin?
- Set quantity of woocommerce product on page visit [closed]
- wp_dropdown_categories and custom attribute
- str_replace function in theme
- Automatically wrap multiple images in div
- Ajax not working properly
- Include default functions and methods
- How can I remove the main description text box in a Woocommerce product editor page? I only use the “Product short description” text box [closed]
- How can I modify all existing tags while keeping the urls themselves?
- Best practices regarding the creation of custom widgets?
- Unable to login using username
- Word Press – Dynamic Content [closed]
- how can I just add to parent theme function(s) instead of redeclaring whole the function
- different style sheet for just one page template
- Condition OR for current user ID
- Where do I store custom functions that call custom page template files?
- Use a shortcode to display custom meta box contents
- Wp-query Order By problem
- login_headertitle is deprecated since version 5.2.0
- Add attribute only to first image of every post via functions.php
- Different favicon on different pages
- The_content and Preg_replace in loaded Iframe [closed]
- Problem with images URL after filter applying
- two search forms on the same page
- Insert a field with PREG_REPLACE – strange behaviour
- How to echo Widget Title in Custom Frontend-Template Box
- New checkbox in custom widget isn’t saving data
- Linking Javascript in functions.php file
- how to display a page before the home page
- loginout function customization
- Function to check if custom page is used by page?
- implementing a centralized content “show-do-not-show” toggle?
- How would I make a function to dynamically determine if user is logged to change navigation menu text?
- How to display this meta data (an array) in form of a function (created with a custom write panel)?
- WordPress – using sessions?
- How to remove font awesome from loading in wp theme
- Header menu aligned right on all pages except for single-post page [closed]
- CF7 select value get to function and reciept value from function
- Hide author info in single posts by certain users
- Extend WordPress Audio Widget to accept HLS (.m3u8) URLs
- Shortcode to insert default text and change one word throughout it?
- I want to customize the_posts_navigation function by replacing prev and next with images
- How Can I Concatenate A String With One Of My Custom Field Value Before Saving The Post?
- How would I correctly implement a new if statement in a child functions file?
- Woocommerce custom calculation function
- WordPress Ajaxifying not working properly
- WordPress function with attribute pass to template
- Will dequeueing in child theme functions.php file prevent Google Fonts from loading?
- Replace image attributes for lazyload plugin on image elements with specific class
- Adding A New Widget to WordPress Disables the Existing Widgets
- How To Show Shortcodes In WordPress Custom Fields?
- Help! Need a different logo on my main page from my other pages
- Display page number on custom page title function
- How do I integrate my Child Theme into a Custom Template?
- Shortcode to eliminate and replace with
- Add functionality to post editor
- custom post with loading script per single post
- Get Value of Custom Field
- restrict access to specific urls on a specific period of time
- child_of not working while searching
- How to request login for user but not for bots
- Why does modifying my functions.php file always result in a server error
- Remove snippets of JS from core
- Removing Facebook contact field from user contact not working
- How do I add functionality to images?
- Explode Array from Repeatable Custom Field
- WordPress Custom wp mail template return full template
- How to create a post without link in wordpress?
- How to crop image in WordPress with aspect ratio for any size of image
- post_row_actions filter from parent theme not executing in child theme
- Customizer cuistom CSS Priority ordre Issue
- Copy and Modified WooCommerce function is_coupon_valid [closed]