You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: search-posts-content.sh
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ echo;
19
19
echo'Beginning search...';
20
20
21
21
# Get every network site.
22
-
all_site_ids=$(wp --allow-root --skip-themes --skip-plugins site list --field="blog_id" --archived=0);
22
+
all_site_ids=$(wp_skip_all site list --field="blog_id");
23
23
24
24
# Loop over every network site.
25
25
forsite_idin$all_site_ids;do
@@ -32,10 +32,10 @@ for site_id in $all_site_ids; do
32
32
echo"Results for Site ID ${site_id}">>$output_file;
33
33
34
34
# Using WP built in search. But "My favorite book" would turn up pages with "my" or "favorite" or "book".
35
-
#wp post list --skip-themes --skip-plugins --post_type='page' --search="${term}" --fields="${fields}" --format=csv --url="${site}" | awk 'NR>1' >> $output_file;
35
+
#wp_skip_all post list --post_type='page' --search="${term}" --fields="${fields}" --format=csv --url="${site}" | awk 'NR>1' >> $output_file;
36
36
37
37
# Search for multi term phrases. Cases sensitive.
38
-
wp db query --skip-themes --skip-plugins --skip-column-names "SELECT ${fields} FROM wp_${site_id}_posts WHERE post_content REGEXP '${search_regex}' AND post_status='publish';">>$output_file;
38
+
wp_skip_all db query --skip-column-names "SELECT ${fields} FROM wp_${site_id}_posts WHERE post_content REGEXP '${search_regex}' AND post_status='publish';">>$output_file;
0 commit comments