[Solved] How to index new posts which was added by the script?
-
Q: We have a script which is adding new files to the WP Media Library in a timely manner, using a cron job. Those files not shown in the search I guess because they are not indexed. We have to log in once in a couple of days to Rebuild Index manually. Is there any better solution to fix this?
A: Yes. Normally when you're editing or adding posts/attachments manually (via WP Admin), each "Save" button click triggers the WP hook "save_post" which is forcing WPFTS Pro to rebuild the index for this particular post.
In case you're making changes by some script, you have to include this code to your script (after all post changes)wpfts_post_reindex($post_id);This will force reindex of this particular post so you never need to Rebuild the whole index after post changes.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login