SELECT *
FROM wp_posts, wp_2_posts, wp_3_posts
WHERE
wp_posts.post_content LIKE '%foo' OR
wp_2_posts.post_content LIKE '%foo' OR
wp_3_posts.post_content LIKE '%foo';
should do the trick.
(Note that in Multisite, there shouldn’t be a wp_1_posts — your root site uses wp_posts etc.)
Related Posts:
- Change all http to https in mysql databse?
- WooCommerce – Query for ordered products
- Delete duplicate rows from wordpress database where a column is duplicate in phpmyadmin
- Database with mixed collation (utf8mb4 & utf8_general_ci)
- Query WordPress database by registered date and role
- Select Multiple meta_value from WP DB; Single Query
- WordPress mysql table double prefixes
- CRUD operations using WordPress database API
- Advanced SELECT query with condtional statements
- Slow queries constantly getting stuck on WordPress database of ~100,000 posts
- Custom WordPress Table wpdb
- Best practice to limit results in get_row()?
- Why does changing Database Table Prefixes result in loss of content?
- SQL query to set posts in bulk based on the post content
- Query Column of Specific ID from Database Table
- How to edit custom table data in frontend
- WordPress Database Query works in phpMyAdmin but not in the code
- How to map data on CSV to web pages?
- SQL Query to get post_id from wp_posts and and meta_key(s) from wp_postmeta
- Have WordPress Use a Different Database for users
- SQL errors when querying for something with apostrophes
- Count views without get_post_meta
- Can’t connect to MySQL server on ‘127.0.0.1’ (10061) (2003)
- phpMyAdmin – Error > Incorrect format parameter?
- MySQL Database User: Which Privileges are needed?
- Why is my database import losing text widget data?
- Will it break my site if I delete all transient records in wp_options table?
- Please explain how WordPress works with MySQL character set and collation at a low level
- Reset Post IDs to less than 64bit integer
- Restoring WordPress posts from database only
- WordPress database scalability from the code perspective
- WordPress Unit Testing – Cannot Create Tables
- Insert data in database using form
- Does WordPress use the InnoDB engine for MySQL by default?
- When is it appropriate to create a new table in the WordPress database?
- Can I use MariaDB instead of MySQL in wordpress?
- Split WP install between 2 databases?
- Inserting Post Meta From SQL
- Why does dbDelta() not catch MysqlErrors?
- BuddyPress: What’s the use of wp_bp_xprofile_data table and how does it get updated? [closed]
- Is deleting orphaned wp_options entries safe?
- Is altering a default WordPress database table update safe?
- How to sort results from a custom database table
- Custom DB_COLLATE (collation) value not working on fresh install?
- What causes the “max_user_connections” warning on WordPress frontend?
- what to do when your WordPress database is too large?
- WordPress and automated MySQL backups to a different host
- How to insert data into MySQL database from the form created in WordPress site
- How Do I Merge Categories With phpMyAdmin
- Size article thumbnails and retrieve them directly from database
- WordPress site uses MyISAM, should I switch to InnoDB necessary?
- How to prevent WordPress from retrieving data for the last 10 posts in the database?
- Query from a different database than the default
- Moving to another host; which tables to move in a database
- WordPress database import: Row size too large
- Why do mass updates to post_content shows in front end, but not in edit screen?
- Error establishing database connection – high traffic?
- Improve performance by removing unnecessary database queries
- Redirecting to old domain after migration website
- Replace/Mute/Stop Search Query
- Switching Databases in LocalHost
- cache specific data?
- Unable to set a default serialized array using dbdelta()
- Multiple instance of data in plugin custom database table on plugin activation
- How to prevent/delay MySQL connections when an object cache is used?
- Migrating from PDO using SQLite to clean new install using MySQL
- Duplicated site isn’t recognized as a site
- Error establishing a database connection,
- Can’t update WordFence Options, clear data manually
- Changing between Local Host DB to Production DB and in reverse
- How and where is wordpress adding mySQL content to database?
- Always get creating a new table with foreign key
- Connecting to a different database
- How to create more than one new wpdb object?
- Should I use an additional column in the DB?
- How Do I Delete WordPress Posts Older Than 400 Days, From A WordPress Category
- $wpdb->get_var – What value is returned when zero records are found?
- Remote database -> massive response time increase?
- Getting “Error Establishing a Database Connection” on localhost in new Mac OSX Lion environment
- Cloning blog to localhost via WAMP
- SQL error with custom query
- Join Query on WP_USERMETA Table
- I imported an restore an database and It shows #1067 – Invalid default value for ‘user_registered’
- local wordpress broke after changing URL
- Exporting Post ID, Post Title, Primary Category and Primary Category ID
- wpdb query to insert images in to post/page gallery
- How to create index (sql) to a meta_key?
- WPCLI search and replace in a particlar site dir effect another site-dir
- Performance bug – slow DB query
- Extracted CSV as Array for Custom Query Loop
- Hang Up Followed By Can’t select database
- Why is converting my database to UTF-8 truncating entries?
- Pulling values from a sepcific row in table
- Using class id from array for query
- Create hundreds of users with just ID in phpMyAdmin
- How to back-up a database on IIS
- export individual posts to text files or a single csv file
- SQL query to rewrite all media URLs to end with .webp
- How do I find users by password?
- Naming conventions for database tables