Questions tagged [search]

The method by which users find information on your WordPress site

Filter by
Sorted by
Tagged with
1 vote
0 answers
10 views

Adding attributes to the core search block form

I'm trying to minimally hook (via a plugin) into the search form generated by the default search block and add a target="_blank" to open the results in a new tab. I'd much prefer to do this ...
  • 482
0 votes
0 answers
16 views

Use wordpress search hooks to search a second database

My wordpress site helps navigate a secondary database that has 9000+ records. I want to use the Wordpress hooks so that my database is searched in addition to the wordpress database of pages and posts,...
  • 115
0 votes
0 answers
16 views

How do I provide a search form for a specific post type, that is capable of searching within custom fields of the specified CPT?

I'm building a site that will have four post types: The default 'page' and 'post' post types. And two custom post types. The two custom post types will have custom fields and custom taxonomies. I'd ...
0 votes
0 answers
9 views

Wp admin: I need search meta key from table wp_usermeta in screen custom post type

In screen custom post type. Custom post type is: "phone_history_list" I have column: "name" → Value of column "name"display from field "meta_key" is "...
0 votes
0 answers
17 views

The search doesn't work properly

The search page, gives results that are sometimes irrelevant. Here is "search.php" : <div class="list-posts"> <?php if ( have_posts() ): ?> <?php ...
0 votes
1 answer
30 views

How do I create a search form that searches only within a custom post type?

My website has a custom post type. I'd like to allow users the ability to search within the custom post type. So I'd like the search results to only include posts of that particular post type. I'd ...
  • 237
1 vote
1 answer
27 views

Wordpress search results grouped by post type

I've been struggling to make it work. This code works and returns post_type title and post titles inside it. I found it here But i need to have some sort of formatting and excerpt. Currently I cannot ...
  • 11
0 votes
0 answers
14 views

Sort Search Results in Order of/by Character @ count (9) of post(s) title. (Ocean-WP theme)

I'd like to order Search Results by the 9th character of Post title. Example) Search Results Page: Current Order: 123456 - B Post Title; 678901 - A Post Title; 789101 - C Post Title; 891011 - 1 Post ...
  • 1
0 votes
0 answers
5 views

search videos on divi builder

I am a wordpress noob and I have to make a website where I have to be able to search 100s of video names so their links can be accessed. what type of module should i use (post/blog/regular text) to ...
0 votes
0 answers
36 views

Search results always returns "No results" no matter what

pre_get_posts hook that never works I used the following code both in functions.php of my theme and in my custom plugin in the "after_theme_setup" hook (pre_get_post code only as it is alot ...
0 votes
0 answers
7 views

Wordpress WP_Query Search ('s') With Multiple Search Terms

I have built a product filtering functionality in Wordpress using the WP_Query object which includes the use of the s Search Parameter. This could be something like "ring" or "necklace&...
  • 111
0 votes
1 answer
19 views

Two Querys in one Search - Category-Tag nightmare - HOW?

Dream scenario: User searches for at state (post tag) to find a relevant service. Every state has its own tag and category. If no service (post) is found a text pops up - something in the region of &...
0 votes
1 answer
18 views

Page not found: Custom search form with a custom search page

Let me show you an example of what I'm trying to achieve. On BBC website when you click the search BBC button on the navbar it brings you to a search page (https://www.bbc.co.uk/search). When you put ...
  • 101
0 votes
0 answers
14 views

Filter with two id of the same value CPT UI(taxanomies)

I have a special link with a filter, so I filter things with slugs through the link, for example mydomain.com/filter/?technology=angular&category=software-development and it shows the chosen jobs ...
0 votes
1 answer
35 views

Amend taxonomy to search in wordpress admin

I am trying to amend a custom taxonomy to a search in the editor area. The taxonomy slug is 'help_cat' and is attached to 'help-center' post types. What I am trying to achieve is very similar with OP ...
0 votes
0 answers
19 views

Custom search template is showing 404 when adding query string

I've created a custom theme and a page template page-search.php, because the original search will search under the homepage url. The page works just fine without query string but when I add /?s=1 at ...
  • 96
0 votes
0 answers
28 views

Include get_term_link inside search

I am trying to include custom taxonomy links inside the search. This is my code that gets the links of my 'help_cat' taxonomy, but I am struggling on how to add/include this inside the search. ...
0 votes
0 answers
30 views

Searching not only by post name but also category

I have a catalogue of cars, where the post name is car model and category name is car brand. When im using search like "BMW" it gives 0 results. How can i make search work with post or ...
0 votes
0 answers
26 views

$wp_query->found_posts not returning correct value

I am trying to search woocommerce products from DB using wp_query, I have used pre_get_posts action to modify my main query. add_action( 'pre_get_posts', 'custom_query_vars' ); function ...
0 votes
0 answers
14 views

How can I modify this code to make the search box include tags and meta

How can I modify this code to make the search box include tags and meta I would like the search in same box if($_GET['s'] && !empty($_GET['s'])) { $text = $_GET['s']; } if($_GET['type'] &...
0 votes
1 answer
24 views

Sort WP Search results by date

I know we can easily sort WP search results by appending &orderby=post_date&order=desc to the search URL like this: https://www.example.com/s=search+terms&orderby=post_date&order=desc ...
  • 3
0 votes
0 answers
17 views

Validate search against a list of codes in wordpress

Hello I have a wordpress website and I need an input field where I need to enter a code and validate against a list of codes. If the entered code is in the list I need to redirect to one page and if ...
0 votes
1 answer
37 views

Problem extending a core block

I need to make a search block by creating a new instance of the core / search block (a basic wordpress block). I tried with the registerBlockType function with which I get this error message: ...
0 votes
0 answers
15 views

How to set a filter search for categories of blog posts in wordpress

How to set a dropdown filter search for blog in Wordpress. I have 3 main categories and some subcategories for each of them. The user should be able to choose multiple categories to filter the results....
0 votes
0 answers
22 views

Search custom type post

I want to make my search bar on the website show custom post type (courses) beside the blog posts. I tried these codes But it did not work. The only thing that worked was the WP Extended Search plugin,...
  • 5
0 votes
2 answers
23 views

Need to search a custom field (ingredients, one long string per post), but want it to allow phrases/non-exact matches

So I have a complex list of ACF repeaters for ingredients, but have a save hook to store them all as one comma delimited text string in a custom field to help. My current "advanced" search ...
  • 101
0 votes
0 answers
95 views

Show Posts via cat+cat in URL that are in both Categories doesn’t work

it seems like i am the only person on this planet currently experiencing this issue. When i search for www.gooloo.de/category/balea+vegan, it should only show posts, that are in BOTH categories, but ...
0 votes
1 answer
27 views

Array_search ignoring the first element [closed]

I made (copy) a function to make the url of the custom post (named investigacion) by year. function tex_get_archives($post_type = 'investigacion') { global $wpdb; $query2 = "...
0 votes
0 answers
14 views

Free search and custom taxonomy query not providing the same result

Two queries that should function the same, provide different results. I've created a custom post type called maarchey_shiur. I've created a custom taxonomy called maarchey_shiur_categories. If someone ...
  • 96
0 votes
1 answer
75 views

Search using ACF repeater

I created a repeater containing Q&A and I would like to develop a search field that looks inside the ACF Q&A repeater for the related result. Could anyone help me where should I start? Thank ...
0 votes
0 answers
21 views

Wordpress search shows protected content

I have noticed many times that WordPress search results reveal protected/locked content. Is it a security issue or do search results show the webpage as viewed by the admin? Sometimes, the content of ...
  • 1
0 votes
1 answer
29 views

WP Search Form Query: Add Author's posts into search query

As the title suggests, I'm looking for WordPress advice relative to leveraging the standard searchform.php functionality to additionally query the author field when performing searches. I've tried ...
0 votes
0 answers
25 views

search.php to search only the post title

I'm trying to rewrite my search.php to search only for the post titles because I have a ton of posts published to my site (around 400k), which slows down the search speed to about 20s per search. <?...
0 votes
0 answers
26 views

How to search by slug and old slug in single API

I need to search for wordpress posts with input slug or old slug only 1 parameter in single API. Now I'm using 2 url: 1. /wp-json/wp/v2/posts?slug=hello-world 2. /wp-json/wp/v2/posts?meta_key=...
0 votes
1 answer
105 views

Include results with tags relevant to the search keyword with JSON rest API v2

Wordpress doesn't natively search for tags so I need to install WP Extended Search and add post_tags as one of its parameters so whenever I search for keywords natively, posts with that tag will ...
0 votes
0 answers
16 views

How to Implement Search Functionality?

<div class="col-lg-8"> <div class="row"> <?php $search_term = get_search_query(); $term = ...
  • 1
0 votes
0 answers
47 views

Display full WordPress post under search form using AJAX

Hi I am currently creating a site that shows interactions between different pharmaceutical drugs. I originally started with Live search on JSON Objects Data Using jQuery (originally based on this ...
  • 1
0 votes
0 answers
25 views

WordPress how to prevent URL encoding in URL of taxonomy terms

Is it possible to prevent WordPress from encoding URL with terms? I have a sample taxonomy term "iPhone5~iPhone7" and when I use it for the search function, it turns to "iphone5%ef%bd%...
0 votes
1 answer
25 views

Post and page content not displaying in search results

I am using a content-search.php template part to output my search results. The post/page titles and links to those posts/pages are working correctly, but for some reason the the_content() function is ...
0 votes
0 answers
15 views

How to have multiple search result pages in wordpress with taxonomy terms listed

I am using a custom theme which has custom post types. First one is Doctors another is Hospital. Both doctors and hospitals have a common taxonomy named specialities. Each speciality has some services ...
0 votes
0 answers
13 views

Search Character Set Problem

I have a local WordPress setup in the Turkish language. I have a post title like ... MAMASI .... When I search by keyword maması in lower-case it doesn't find post. I try the table Character set ...
  • 181
0 votes
1 answer
27 views

How to remove the message 'We could not find any results for your search' without changing template files and without adding posts/pages?

I take the question back with context. The goal is not to add posts or pages so that the post is replaced by the title of the post/page. The goal is not to modify the search.php file to remove this ...
0 votes
0 answers
18 views

Type character in name and make it invisble

my website is using MyHome theme. I need to write identical names for two search fields. Here - https://komand.suvenirite.net/dava-pod-naem/?offer-type=rent And here- https://komand.suvenirite.net/...
  • 1
0 votes
1 answer
25 views

How to set "split_on_numerics" to false in ElasticSearch mapping using ElasticPress? (for proper SKU search in WooCommerce) [closed]

I've been using ElasticSearch v7.10 installed on the same server that I have a website in WordPress with WooCommerce, that is connected using the plugin ElasticPress v4.0. I am trying to modify ...
  • 33
0 votes
0 answers
66 views

How to create a search form with multiple search fields

I have a client that would like to add a search facility to their site but... They would like to allow the user to search various different custom fields. Here's an example of the sort of thing I'm ...
0 votes
1 answer
19 views

Wordpress search WP_Query to cover multiple post types and their custom fields?

I am trying to make the WP default search a bit more intelligent, by having it use custom fields. It searches through my custom post types, but only for the usual fields (excerpt, title, content). In ...
0 votes
0 answers
35 views

Best approach to make all tags searchable by the wordpress search function

I have over 2000 tags on one of my sites and I like them to be searchable by the wordpress search function. The problem is if I use a plugin, the time it takes to search them all is enormous. I think ...
  • 299
0 votes
0 answers
28 views

Display WordPress search results based on the selected Sub-Category

I'm trying to create a search using dropdowns in WordPress. I've got two dropdowns, 1 - Parent Category and 1 - Sub-category. The Sub-category will show automatically based on the selected Parent ...
  • 11
0 votes
0 answers
13 views

How do I set the Stewart Search Template to return only published posts in the result

I recently took a WP.com online webinar and the moderator referred me here to ask my question. I am trying to redesign my site using FSE. I am using the "Stewart" theme. I have added a ...
  • 1
0 votes
0 answers
53 views

Woocommerce AJAX filters option loading spiner - problem on mobile device

I've got quite weird problem. I built product filtering options, sometimes the server is slower so I wanted to add a loading spinner while you wait for the results. I only managed 50% because it works ...

1
2 3 4 5
36