php - Can you make all Wordpress pages Private simultaneously without a plugin? -


i have wordpress installation thousands of pages public need make private. can't use plugin me; need using wordpress' built in public/protected/private paradigm.

ideally, run search , replace on sql export of database. alternatively, willing write php script handle it.

it not option make pages private manually - looking programmatic method dealing problem.

can help?

just set them private in database, using following query:

update `wp_posts` set `post_status` = 'private'; 

this set all posts private, guess won't use query.

instead, set articles 'private' use:

update `wp_posts` set `post_status` = 'private' `post_type` = 'post'; 

and disable pages, use:

update `wp_posts` set `post_status` = 'private' `post_type` = 'page'; 

post-revisions have status 'inherit' , right inherited parent page or article.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -