try this to exclude images from search. Add code to your functions.php:
// Exclude images from search results - WordPress
add_action( 'init', 'exclude_images_from_search_results' );
function exclude_images_from_search_results() {
global $wp_post_types;
$wp_post_types['attachment']->exclude_from_search = true;
}
Related Posts:
- How do I get the avatar URL instead of an HTML IMG tag when using get_avatar?
- Programmatically get images by URL and save in uploads folder
- Function to get URL of original uploaded image – full size
- How to reference a theme image in a stylesheet?
- Mixed content warnings after changing site adress from HTTP to HTTPS
- Preview Image Path in Admin Section
- Why would image paths in wordpress suddenly change?
- Remove the http protocol from images
- How do i reference the theme path in pages for images?
- @wordpress/create-block image url in css
- WordPress url image redirect to the homepage
- Broken urls with http site and https wp-admin
- A way to change image urls in post to cdn image url?
- How to change image url?
- Update image links in database
- Shortcode for a link and thumbnail
- media_sideload_image with rewritten urls?
- Searching for any images in media library displays “no media found”
- How to add an image to a custom url?
- images not showing after transfer
- Change media URL (images)
- Exclude image titles from search results
- How to redirect homepage to actual URL?
- Clicks registering on Preview DNS site
- Is it possible to enable the ‘Link To’ field under ‘Attachment Display Settings’ for a Featured Image?
- Using a .pdf file as a page in wordpress
- How to get image URL from media_sideload_image?
- Redirect Image Url to a page via htaccess
- How to pass on a value as parameter via url to another page
- How to replace post image url before posting using api?
- Hide or mask the url to an image
- Glitched page redirects to image
- i want to change URL of WordPress image or rewrite in runtime
- Change Image in Mobile Search Results
- How to show a full page when someone links directly to an image on my site
- Bypass wp_safe_remote_get()?
- Which tools should I use for a gallery that uses an API and url for the path of the images?
- List sub pages with custom field content converting image ID to URL
- How to display image thumbnails on the search results page?
- Change the image for a certain URL
- Setting name of attachment URL
- Search and replace image urls in posts
- Protocol relative url not pulling up images on IE, FF, and OPERA
- Broken image URL
- How do I mitigate the forward slash problem for URLs of images after a WP migration?
- Images in sub-pages fail to load
- get_post_custom: get image URL instead of image ID
- Are image addresses security relevant?
- Remote Image (from URL) as Media Library element
- WPALLIMPORT Exporting images from repeater field [closed]
- Remove images (files) that were generated when using add_image_size()
- Which action hook can I use when a featured image has been selected
- Image resize with image url
- The WordPress Gallery, Grabbing The Link and Images?
- Featured Images on Front Page
- How to upload images from my directory into my wordpress?
- Ability to edit image via WYSIWYG
- Images are randomly deleted from server
- Rename media files generated during upload
- Image popup in a lightbox / overlay from the backend 3.5 admin area (plugin)
- Auto resize images after adding a new size
- media sideload image and Google Content
- offload media to external services [closed]
- How can I insert an image map into a WordPress blog post?
- How to filter the image embed code based on link type
- Include image in excerpt
- Retain the original name of the image on resize
- Scrape external webpage for first image and add it to new post
- Creating a post image to show in a gallery
- Don’t show images inserted into content
- Replace post/page titles with an image in WordPress
- What happened to the media manger?
- Remove Image Sizes in Media Settings Page
- image_resize() with blank space [closed]
- Re-ordering images in existing post in wordpress 3.6.1
- Change Image folder Locations
- “HTTP Error” or Network Error (tcp_error) when uploading image
- Optimising uploads folder then re-uploading?
- How come the images arent loading properly?
- Random Image Script Working but Want to Avoid Duplicates
- HTML Img with data:image src gets sanitized in admin?
- Can’t find image to remove
- How to link image in WordPress – Elementor when certain element does not offer that option?
- Large uploaded images not resizing?
- How can i place featured image after h2
- Custom image size not displaying with wp_get_attachment_image()
- unsharp thumbnails after uploading image
- How to delete original image file after upload and resize
- Access html element in media modal with jQuery
- Jetpack Lazy load images fade in
- How to make image uploads default to full size?
- Image is missing on site homepage
- Changing current post image uls with a function
- How to display every pictures from all the posts on one page?
- How to add multiple images in a page
- how to display all images from their siblings/ from same parent?
- Define Folder to save Images
- adding images to wordpress pagination?
- Custom filename when pasting an image from clipboard
- How do you change all images dimensions to have the same size?