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?
- WordPress Settings API Overrides My Previous Value
- What structure and database storage method should I use for temporary storage that may be written concurrently?
- how to access 2nd Mysqli Database from different server for wordpress
- adding user_id and name to a separate table whenever a user register based on role
- Move Non-WordPress users table to WordPress database
- Is there any defects for using same database prefix in WordPress for multiple sites?
- Can we store password in without being hashing?
- Migrating meta_key and meta_value from old theme to new one
- Error establishing a database connection – WordPress setup, everything else is working
- Migrating my site to a new domain does not keep any changes made in customizer
- Restore of database doesn’t show content
- How to check and get json object in WP database?
- Why theme settings lost when I installed https
- How can I find user role in Mysql?
- How do you enable scripts on a WordPress installation in Softaculous?
- pre_get_posts causings DB error when using ( ‘posts_per_page’, -1)?
- generate PDF from member information
- How would I see which wordpress posts have a revision history without opening each one?
- SQL database import #1046 error
- set_transient fails if the value has more than 60.000 characters
- WordPress how do I echo SUM from a column of a MySQL table by user id AND type_operation
- New Page/Post Screen Opens an Existing Post
- How to access a table in a wordpress database using REST API?
- Creating a custom form with ability to query and submit to SQL
- How do I change several broken URLs in a several wordpress databases in the fastest way?
- Change user_nickname for author page link
- How do I cleanup my database with data that is no longer being used?
- Insert variables into wpdb in custom post template
- How to import products in host instead of database on wordpress?
- What is recommended data type and encryption type for password in a database
- Unable to login to a https website via the app after changing from http
- $wpdb->insert duplicating rows
- Is there an actual way to synchronize ‘production’ and ‘develop’ WordPress databases?
- Lost database connection
- How to force set same page as homepage and blogpage in static page settings
- mysqli_query(): MySQL server has gone away for Curl Request
- How to rerieve comments and their replies from DB
- Inserting data with Geometry field
- Getting values from form and saving in database but spaces are inserted instead of form values
- Troubles when I want to connect to another DB
- Intermittent Yet Problematic Error – “Error Establishing A Database Connection”
- WordPress site migration – locked out of admin area
- How to extend WP_query to a specific table?
- Get all top categories, then only 3 posts for each
- Best way to store 1 billion+ posts?
- Having all “non-PHP” files on a different server
- Can I use a wpdb object to connect to a non-WordPress Oracle database [duplicate]
- syntax error for changing user role from database
- Optimize WP site for millions of posts
- Advice on how to structure a custom plugin
- Is it safe to add INDEX to a column in WordPress database?
- Error establishing a database connection with XAMPP
- is it possible to install new WordPress in an old WordPress folder?
- I Want a More Concice Form of Data than an Array
- Malware in old website – how to migrate?
- Free version of Relevanssi doesn’t show ACF fields
- Can someoene please help with customization of a post?
- I would like some help wth an SQL query to link posts with categories
- How to have differents sites share the same tables of DB?
- Communication in between WordPress database and another (not WordPress) database
- How do I loop/iterate through posts to edit all img tags?
- Is it possible to separate databases in WordPress site – one for orders and the other for all non-orders related
- Error establishing a database connection in wordpress