Replace URL with Site Title in Search Results

What you are seeing is correct. Google display in SERPs (Search Engine Results Pages) listing as follows: URL Page Title Page Description [ other attributes (potentially) ] Your top result: Tattini Boots – 1860 | Italian English Riding Boots – U.S Links to: https://www.tattiniboots.com/ …your homepage.

how to hide specific post from google search

Hook into the action wp_head, test if you are on the category archive or a single post with that category, and print the proper meta element: add_action( ‘wp_head’, ‘wpse_91073_noindex’ ); function wpse_91073_noindex() { if ( ( is_singular() && in_category( ‘CATEGORY_SLUG’ ) ) or is_category( ‘CATEGORY_SLUG’ ) ) { print ‘<meta name=”robots” content=”noindex”>’; } } Replace … Read more

How do I search WordPress by different fields without a plugin?

I found a solution that allows me to search posts by tags and categories while still searching title and content. This does exactly what I was looking for. Credit: https://rfmeier.net/include-category-and-post-tag-names-in-the-wordpress-search/ add_filter( ‘posts_join’, ‘search_join’, 10, 2 ); /** * Joins the terms, term_relationship, and term_taxonomy tables. * * @global $wpdb * * @param string $join The … Read more

why does bones theme call the_excerpt function with parameters?

This is a bug in the theme. The real function does indeed not use the parameter: /** * Display the post excerpt. * * @since 0.71 * @uses apply_filters() Calls ‘the_excerpt’ hook on post excerpt. */ function the_excerpt() { echo apply_filters(‘the_excerpt’, get_the_excerpt()); } PHP will just ignore it, but the unnecessary gettext call should be … Read more

Multisite Installation: how do I setup global search?

I think the best way to do it is to index all the posts and search through them in database. This method should be the fastest when you perform a search because you can filter posts, create the pagination etc. Check this tutorial https://rudrastyh.com/wordpress/search-across-wp-multisite.html Another way is to to something with switch_to_blog() function – I … Read more

Custom Query to search through categories

It sounds like you’re looking for the get_terms() function that’s a wrapper for WP_Term_Query. There you can e.g. use the name__like, description__like or search parameters. Example: Here’s what kind of WHERE query they generate: ‘name__like’ => ‘hout’ >>> (t.name LIKE ‘%hout%’) ‘description__like’ => ‘hout’ >>> tt.description LIKE ‘%hout%’ ‘search’ => ‘hout’ >>> (t.name LIKE ‘%hout%’) … Read more

How to search through pdf media files?

The built in WordPress search doesn’t index PDF file contents, however Google does, there’s a good tutorial on DevPress on replacing WordPress search with Google Custom Search.