1

I have a blog website with some old posts and they appear in my "featured" posts section. I put those posts with noindex and but they still show up. is there a way to remove them from wp_query?

5
  • Please share us what have you tried so far? Jun 10 '19 at 7:39
  • mostly searched on here and google and found nothing.. dont really know even where to start
    – Asaf Hadad
    Jun 10 '19 at 7:45
  • There is pre_get_posts hook to customize query. You can exclude certain posts from the query with using post__not_in parameter. See developer.wordpress.org/reference/hooks/pre_get_posts if it may help. Jun 10 '19 at 7:55
  • Do you want to remove them from every query? Do you want remove them only from featured post?
    – Azer
    Jun 10 '19 at 8:08
  • I want to avoid using post__not_in because it's a lot of posts in diffrent categories and i dont want to change the code everytime a post is added to my list. I want that if a post has noindex it will not show on the posts that come back from the query. I'm not sure about the diffrence between remove from query or from output.
    – Asaf Hadad
    Jun 10 '19 at 9:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.