از این کد میتونی داخل functions.php استفاده کنی:
PHP:
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;
}
اگر جواب نداد، این کد رو هم تست کن:
PHP:
add_action('wp_loaded', 'exclude_images_from_search_results', 100);
function exclude_images_from_search_results(){
if ( method_exists('TC_post_list', 'tc_include_attachments_in_search') )
remove_filter( 'pre_get_posts', array(TC_post_list::$instance,'tc_include_attachments_in_search') );
}
راحت ترین و بهترین راه، استفاده از قابلیت memcache و cache کردن دیتا برای مدت 3 روز هست. (کلا چند خط کد، کار میبره. البته برای این مورد نیاز هست که memcache رو هاست و سرور فعال باشه)
از راه های دیگه میشه به ذخیره دیتا در یک فایل یا ذخیره دیتا در دیتابیس، اشاره کرد