This is what I mean:
<?php
$tochange = get_posts('numberposts=-1&post_type=any&category_name=category-name-you-want-to-change');
foreach($tochange as $post){
setup_postdata($post);
$contentchange=""; /*here you do the magic, string replace or whathever you want to do*/
$tochange = array();
$tochange['ID'] = $post->ID;
$tochange['post_content'] = $contentchange;
$out = wp_update_post($tochange);
unset($tochange);
}
wp_reset_query();
?>
Related Posts:
- Show a different number of posts per page depending on context (e.g., homepage, search, archive)
- wordpress function to change post status [duplicate]
- Is their any way to Extend WPDB class and Overwrite the Default Query Function
- Using nextGen Gallery.. how can I call a list of all Gallery Names?
- Search and replace text across all posts
- How to check if wp_update_post was successful
- [Plugin: Posts 2 Posts] How does it work?
- Post query – show posts from specified day and month and whole years
- Display success message after wp_update_post
- Plugin echos text from shortcode function in gutenberg page editor
- List taxonomy terms for post as checkboxes
- WP Query. Is there a maximum size?
- WordPress and a secondary database?
- plugin code is pulling information from database in one instance and not in other. What is wrong?
- WooCommerce search products between price range using WP_Query
- correct validate and sql query
- correct sql query
- SQL query, error
- Create a post builder skin in a plugin
- Taxonomy Drill-Down / Plugin Help – hierarchical queries within plugin?
- How to customize a title by passing query string?
- What is the best way to cache pages on WordPress
- Always get creating a new table with foreign key
- problem with sql query
- add_query_arg not work in admin
- How to return the values from a row where a value occurs for the first time among the rows available?
- How to use apply_filters?
- How to search post titles with whole words only, but not the exact word only?
- Change language on website and change currency with url query
- Displaying different content depending on variable
- How to create algorithm for ordering posts in WordPress?
- Multiple Meta key in search
- Having trouble going from Jfiddle to implementing in WordPress :(
- wp_update_post function ignores HTML tags
- Proper way to trigger a MySQL query via link in a plugin
- get_var result empty for query of custom table in plugin admin
- WP-Snap too slow (caused by WP_Query?)
- why the current date do not update
- Using wp config to connect to a DB from a plugin
- wp_update_post does not change post status from draft to publish, returns 1
- ‘Active lotteries’ only custom query for woocommerce lottery plugin and elementor
- Suitable hook when creating, updating and deleting posts programmatically
- WordPress additional update of publications after importing WP All Import Pro
- Remove posts that start with similar words (like a delete duplicate posts plugin)
- Automatically install wordpress plugin at theme activation
- How to run Two WordPress blogs with different themes and with single database and same content
- How to show custom message once on plugin activation?
- How to notify users of blog updates a la Admin Plugin Update notifications?
- How to list all active and specific shortcodes in wordpress
- Best Way to Remove WordPress Meta Box based on Post Status
- plugins_url() incorrectly returns a url with www subdomain
- Compatibility with RTL installations
- Variable from a plugin into a theme
- update_user_meta add value on the top on existing value
- Where to access the available plugin/WordPress updates?
- How can I display a contact form for out of stock products in WooCommerce?
- How to disable specific plugin in mobile version?
- get_post_type on post.php
- WordPress Backend HA (Automatic failover)
- Customize The Events Calendar to Include an Option to Expand for More Events Listings
- Does the lazyload plugin make this server disks busy?
- Load Javascript from Plugin in One Page Only?
- How does one include the JQuery UI plugin to wordpress and enque it correctly in a plugin form?
- the_post hook is not firing for me
- Invalid plugin installation directory, Google Analytics [closed]
- Custom url rewriting
- Why are my WordPress store items showing up in duplicates?
- Change the number of plugins counted on wp-admin/plugins.php
- How to have free shipping for WooCommerce Membership members
- Can i use init hook for API purpose?
- JSON API Plugin not showing Attachments id reused
- Loading by Ajax a plugin that also uses Ajax
- how to set parent forum link to menu page?
- How can i list random author?
- Notify bar plugin not showing up
- How to get values from network settings panel?
- Creating New Dynamic Fields for a Certificate (Number Generation, Code Referencing, and more)
- how to validate input field in wordpress generated with wpform plugin
- Remove custom taxonomy name from the slug – Custom Post Type UI
- Conditional delete metadata does not works
- Ability to change homepage on WordPress using API
- The function called on the wp head hook becomes null
- WordPress plugin download-after-email issue
- Custom shortcode being shown in WPBakery backend rather than the block
- How to disable/enable a plugin at a specific time
- Enable plugins that are “not supported”
- How to show a message to a user?
- WP-admin plugin installation via FTP silently fails on shared hosting
- Is it possible to restrict content in wordpress?
- Prefix of $wpdb does not worked and does not displayed
- Custom Widget not Available after Plugin Installation
- How to allow customers to input a text as a product variation *and* charge per character?
- Can I have a link within a WP UI Spoiler
- How to structure plugin in to functions?
- Plugin Admin Page Ajax-Admin call returning 0, URL set correctly. Implemented localized scripts but did not fix it
- booking form with availability calendar [closed]
- Move a single Plugin [closed]
- Animate like Stack exchange frequently asked questions [closed]
- warning wp session
- Google Books Lookup & Auto FIll