0

It looks like when you search for the domain name in the wordpress search box, you get all your content listed because the domain name is in each permalink. I've tried many things, but it seems to be "harcoded". Is it normal ? How can I get this work 'normally' ?

thx for your time !

1 Answer 1

0

When we try searching for example.tld, then the default search query looks into the post title and content with:

  ... (wp_posts.post_title LIKE '%example.tld%') 
OR (wp_posts.post_content LIKE '%example.tld%') ...

When we add an attachment or a local link, into the post content, we normally get the full url, for example:

http://example.tld/wp-content/uploads/2015/05/image.jpg

so I would think that you're just picking up those in your search.

Try for example to create a post with the title Test but without any post content and see if it shows up in your search results.

1
  • you're so right... I've looked into the code eventually, as you did, and ended to the conclusion. Thx for pointing this out !
    – nderambure
    Commented May 28, 2015 at 22:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.