If you never send/sync Production posts to live.
Then just pull/copy the live database to the development database via mysqldump (or similar) and use wp-config vars to force the site and blog URL.
Use the following in the dev versions wp-config.php to force the URL’s
define('WP_HOME','http://example.com');
define('WP_SITEURL', 'http://example.com');
You may as well sync the entire database, rather than just posts, so then you get all the post revisions as well as any plugin configurations/data.
This is my normal method of developing a live site, locally. (Grab live DB drop Dev DB import Live DB into Dev) (The only fun bit is sending specific plugin configs up to the live site from the dev site)
Related Posts:
- Database synchronization between dev/staging and production
- What actions affect files, DB, or both?
- MySQL Database User: Which Privileges are needed?
- How can I make updates to a site, on a development copy, but then move updates back without overriding live site’s evolving database?
- Safest way to bulk delete post revisions
- How can I make a WordPress database portable and url independent?
- Why does $wpdb return strings for mysql integer values?
- Dealing with Many Meta Values, 30+
- When is it appropriate to create a new table in the WordPress database?
- Ways of managing staging and production wordpress sites?
- Is it possible to switch the data layer within WordPress?
- store simple data in get_option()
- How to delete outdated, wrongly sized images in _wp_attachment_metadata?
- Have multiple local wordpress installs share a wp-content folder and database
- How to implement content from external database into WordPress text page? [closed]
- Cloning and syncing a WordPress website
- Add search Value to wp_list_table pagination
- How to fix unchanged URLs in Database after running serialized search and replace script?
- Should non-WordPress data get its own DB?
- Who is responsible for data sanitization in WordPress development?
- Search and replace special characters (å,ä,ö) for image attachments only in database
- Localhost to Staging to Development Dynamic WP-CONFIG
- Setup 3 Sites To Connect To 1 Database and Share Data
- Uknown meta entries in wp_postmeta
- Changing between Local Host DB to Production DB and in reverse
- creating new field on mysql
- Why user_pass column in wp_users table is varchar(64)
- Can local WordPress installs share /wp-content/ folder and database?
- SymmetricDS in dev + prod workflow?
- Database migration issues – Error #1046 No database selected
- A WP dev site that displays content from a live site’s database but cannot write to wp_posts?
- WPCLI search and replace in a particlar site dir effect another site-dir
- Merging development site with live site
- One WP Database outside localhost and two connections
- Get id from database
- Share WordPress Database
- MySQL Database User: Which Privileges are needed?
- Checking if Database Table exists
- How To Export/Import WordPress (MySQL) Database Properly Via Command-Line?
- Is it possible to define two databases for one installation?
- Syncing local content with development / staging sites
- Export WP database for import using WP-CLI on Vagrant Box
- Improve or optimize a very slow query
- What is the advantage of separating wp_users and wp_usermeta table?
- “MySQL server has gone away” since update to 3.8
- WordPress page title repeated in SOME pages
- Theme Activation, Create Database Tables
- Why is $wpdb->get_results failing on certain tables but not others (which have data)?
- Custom search page and search by title, content and tag
- How to correctly add a table to the WordPress MySQL database
- MySQL Syntax Error upon restoring database from backup [closed]
- Help running a MySQL query to update all wp_#_options tables in a Multisite install
- Automate dir and DB stack creation with WP-CLI
- Moving WP from local server to live, error establishing a db connection
- WordPress and MySQL: how to transfer Meta_key and Meta_Value from one post_id to another
- Exporting table to csv works in the admin but exports HTML data when used on the front end
- wp search-replace (not executing)
- Create table from array with prepare
- Migrate database between 2 different wordpress version
- SSO system between 2 WordPress installs on different servers
- Form that sends data to an admin panel and can export it
- Convert user passwords to MD5?
- is wordpress stores Role Id in WP database?
- Why do database examples sometimes finish with an add_option call?
- Does post_meta data need to be unserialzed?
- How to backup my site and restore my wordpress site
- How to fetch records from database WordPress
- How safe is it to delete old posts edits to save database space?
- How get Data form wordpress database as array not stdclass?
- cannot connect database
- Multiple WordPress sites installs sharing the same database but with different content and domains
- Brandoo WordPress Unable to Update to WordPress 4.2.2
- Connecting to wordpress database in my application [closed]
- Remote database -> massive response time increase?
- Custom Post Type not showing anything added by code anymore?
- How do I have a user upload a blog post and then retrieve that to display in a card on the site?
- Delete user with only subscriber role
- WordPress keeps redirecting to localhost
- How to rename custom table name programatically in wordpress?
- How to edit custom table data in frontend
- pre_get_posts causings DB error when using ( ‘posts_per_page’, -1)?
- generate PDF from member information
- mysqli_query(): MySQL server has gone away for Curl Request
- Help posting values to DB on submit using $wpdb->query
- create a table using user meta custom data
- wpdb query to insert images in to post/page gallery
- Creating a database in my plugin not working
- How to create index (sql) to a meta_key?
- get_user_meta and umeta_id
- $wpdb not working
- Send data to database after redirect (and popping out of iframe)
- Simple email input store in database
- Pulling values from a sepcific row in table
- import (migration) user database to wp-users
- Insert Extra fields added in the front end registration form to DB
- WordPress Multisite platform for different city for single db
- $wpdb->insert not working for last select option
- How to create a table [closed]
- Upload wordpress from localhost to 000webhost
- WordPress database connection failed, while mysql client is working [closed]