Forum Replies Created

Viewing 15 replies - 1 through 15 (of 37 total)
  • Thread Starter jasghar

    (@jasghar)

    @rankmathsupport Thanks much, this solution is working, before reaching out to you I was doing the same previously but the only mistake I was making was saving the array in serialized format.

    update_post_meta( $post_id, 'rank_math_robots',  serialize($arr)  );

    Thank you for the help

    Thread Starter jasghar

    (@jasghar)

    Hi @rankmathsupport

    Thank you for the response and the code you provided is working to some extent but I guess this is not what I want

    See it’s only setting the post to noindex on frontend but if I open the backend of the post and go to advance tab I see the ‘index’ checkbox is checked

    IDK if I should be concerned about this or not, but it will be hard for me to check from the back if the post if marked as noindex or not

    Also, I’m bit concerned about the search engine crawlers, like if I use the provided code will they skip indexing the slideshow posts or will they index these posts? because I dont want search engines to crawl these posts with term slideshow


    Thanks

    Thread Starter jasghar

    (@jasghar)

    Hi @rankmathsupport , thanks for the reply

    I do know about the setting you mentioned but it will not work in my case because it will set meta tag on each and every post

    but the thing is I have a custom taxonomy ‘feed_type’ in my website and this custom taxonomy have a term ‘slideshow’ I only want to noindex the posts where the taxonomy is feed_type and term is slideshow, that’s why I was using this code

    function ayl_noindex_msn_post( $post_id ) {
    if( has_term( 'slideshow', 'feed_type', $post_id ) ) {
    $arr = ['noindex', 'nofollow', 'noarchive', 'noimageindex', 'nosnippet'];
    update_post_meta( $post_id, 'rank_math_robots', serialize( $arr ) );
    }
    }

    add_action( 'save_post', 'ayl_noindex_msn_post' );

    to noindex the post on save only if the post have taxonomy of feed_type and term of slideshow

    Hope it make more sense to you

    Please let me know how can noindex the posts specifically of taxonomy feed_type

    Thanks

    • This reply was modified 2 months, 2 weeks ago by jasghar. Reason: accidentally saved the post without completing it
    Thread Starter jasghar

    (@jasghar)

    Thanks for the reply, but I’ve already checked this uncropped option but its still showing me resized image in the single product page

    <div class="tpslick-slide tpslick-current tpslick-active" data-tpslick-index="0" aria-hidden="false" style="width: 470px;"><div><div class="tpwpg-big" style="width: 100%; display: inline-block;"><span class="tpwpg_zoom" id="ex1" style="position: relative; overflow: hidden;"><img src="https://woocommerce-1075789-4127207.cloudwaysapps.com/wp-content/uploads/2023/12/Untitled-1oi977-scaled-600x600.jpg" class="tpwpg_image_src_big" data-src="https://woocommerce-1075789-4127207.cloudwaysapps.com/wp-content/uploads/2023/12/Untitled-1oi977-scaled.jpg" data-imgsrc="https://woocommerce-1075789-4127207.cloudwaysapps.com/wp-content/uploads/2023/12/Untitled-1oi977-scaled-600x600.jpg" data-imgid="34918" alt="Untitled-1oi977" title="Untitled-1oi977"><p class="tpwpg_zoom_txt">Hover</p><img role="presentation" alt="Untitled-1oi977" src="https://woocommerce-1075789-4127207.cloudwaysapps.com/wp-content/uploads/2023/12/Untitled-1oi977-scaled.jpg" class="zoomImg" style="position: absolute; top: -1036.62px; left: -1516.36px; opacity: 0; width: 2560px; height: 2560px; border: none; max-width: none; max-height: none;"></span></div></div></div>

    This is the slide HTML of the image and Its coming from the short code notice the first img tag

    <img src="https://woocommerce-1075789-4127207.cloudwaysapps.com/wp-content/uploads/2023/12/Untitled-1oi977-scaled-600x600.jpg" class="tpwpg_image_src_big" data-src="https://woocommerce-1075789-4127207.cloudwaysapps.com/wp-content/uploads/2023/12/Untitled-1oi977-scaled.jpg" data-imgsrc="https://woocommerce-1075789-4127207.cloudwaysapps.com/wp-content/uploads/2023/12/Untitled-1oi977-scaled-600x600.jpg" data-imgid="34918" alt="Untitled-1oi977" title="Untitled-1oi977">

    The img src is the resized version and the data-src is the original version of the image. I want that original URL to be in the src attribute,

    How can i do that any idea?

    Thread Starter jasghar

    (@jasghar)

    Hi @cornelraiu-1 , I’m finding myself in a loop

    the end goal was to prevent spammy searches and customize the default search functionality of WordPress to make it easy for user. means if user searches for ‘sales career’ then it will take the career word and redirect user to careers page. if user searches for ‘cats driving ford’ then it will take ford and redirect to inventory page with make of ford filter applied. if user searches for ‘about trump america’ then it will redict user to about us page.

    You get my idea right what I’m trying to implement. just customizing the default search to make it little good for user.

    now the thing is in my search customize code I’m replacing the explicit words (18+) words and replacing them with empty strings which is working well but that search is being calculated and stored in db.

    for example

    if user searches for ‘artificial Intelligence creates content for the site, no worse than a copywriter’ it will take the word ‘for’ and redirect to inventory page with make filter applied and will show listings of ‘ford’ vehicles. but the plugin will store the search term of ‘artificial Intelligence creates content for the site, no worse than a copywriter’ you got my idea right?

    this dummy search string ‘artificial Intelligence creates content for the site, no worse than a copywriter’ can be replaced with explicit (18+ adult) words in my code i am filtering it, but can i add this in plugin so it dont add searches with these words in db. something same as we did with excluding the symbols from search

    I know its a little tricky please do let me know if you need anything else from me

    regards

    Junaid

    Thread Starter jasghar

    (@jasghar)

    Hi @cornelraiu-1

    is there any way i can add the 18+ words like s**, p*** and others in your exclude search in case it contains certain words’ field?

    so I need to insert using backslash like this? \junaid

    if i need to exclude junaid from search. same goes for other words?

    I’m trying to make the search very much exiting and trying to add some cool functionality like with search it can redirect to any page on website. to inventory page in case if a match found with filter applied and some other stuff.

    regards

    Junaid

    Thread Starter jasghar

    (@jasghar)

    Thank you so much @cornelraiu-1 I can’t thank you enough for what you did for me.

    I’m using this way and its working pretty fine till now.

    I’ll let you know if I get any other issue regarding this.

    Once again Thanks

    Junaid

    Thread Starter jasghar

    (@jasghar)

    Hi, Just want to know how can i add a plus sign in this pattern so the searches including plus sign also gets excluded

    \/,_,\{,\},\[,\],\.,\|,\\,\.jp

    do i need to add like this \+

    Thanks

    Junaid

    Thread Starter jasghar

    (@jasghar)

    Hi, I somehow managed to update the live site and the provided code appeared to be working fine. I made like 20 searches and it did add the searches in db but it excluded the searches containing the letters added in the ‘exclude’ field.

    But I’ve a question

    Is this the best of solution for the issue?

    It’s recording multiple entries means if I search for ‘ford’ it will add ford in db. if i search for ‘ford’ again the second time it will still save it in db. and will show duplicate entries. is it because I enabled the country option in the settings page?

    what are these settings for?

    exclude doubled search for same user if interval is lower than (minutes):

    Add custom search parameters for recording the searches:

    ///////////////////////////////////////////////

    Just to ask if you could add a feature where we can exclude searches longer than some desired letters or work?

    Thanks for all your support

    Junaid

    Thread Starter jasghar

    (@jasghar)

    Thanks for providing this.

    Right now is day time and the website is functional I’ll try this after 6PM Mountain time. Like 12 PM romania time today.

    Thanks. will try and update you.

    Junaid

    Thread Starter jasghar

    (@jasghar)

    Hi, Here is the pattern i am using in exclude search string field

    /,_,{,},[,],.,|,\,.jp,

    here are the content of settings i’ve set

    Thread Starter jasghar

    (@jasghar)

    Hi @cornelraiu-1 ,

    Thanks for a detailed comment

    • I already tried by removing that previous code from functions.php but issue still there
    • Already tried to remove all data using Erase all data option in settings also I tried to uninstall the plugin then deleted the plugins tables from db and then reinstalled but issue still there. also i tried to remove entries from db then switch to troubleshoot mode then tried and issue still there.
    • ummm not sure about this cause no user going to search for that string and if a user is new to website for sure he will not be aware of the pages of website and theres no way he can search for that string with exact pages and vehicle names in it. if a user is already familiar with website why he would search for something like this with exact same pattern always.
    • I dont think the searches are made by the users cause when i removeed entries and tried to search then after maybe like third search 2 extra auto generated searches were added.
    • yes I do have country option enabled but the plugin is not showing country.
    • no ajax calls running with s=
    • I did added custom search params like this.

    but as you mentioned that you are using regex and having trailing comma might break it then how should i place it in this field

    BTW i do have a code which i am using to check for user search terms and redirect them to their exact searched page heres the code

    // check the searched term
    function search_listings_meta() {
        if (isset($_GET['s']) && !empty($_GET['s'])) {
            $term = sanitize_text_field($_GET['s']);
            $meta_query = array(
                'relation' => 'OR',
                array(
                    'key' => 'stock-number',
                    'value' => $term,
                    'compare' => '='
                ),
                array(
                    'key' => 'make',
                    'value' => $term,
                    'compare' => '='
                ),
                array(
                    'key' => 'model',
                    'value' => $term,
                    'compare' => '='
                ),
                array(
                    'key' => 'vin-number',
                    'value' => $term,
                    'compare' => '='
                ),
                array(
                    'key' => 'postName',
                    'value' => $term,
                    'compare' => 'LIKE'
                ),
            );
            $args = array(
                'post_type' => 'listings',
                'meta_query' => $meta_query,
            );
            $query = new WP_Query($args);
            if ($query->have_posts()) {
                $url = add_query_arg(array('search%5b%5d' => $term), home_url('/inventory'));
                wp_redirect($url);
                exit;
            }
    
            // compare search with pages
            $page = get_page_by_title($term);
            if ($page) {
                wp_redirect(get_permalink($page->ID));
                exit;
            }
        }
    }
    add_action('template_redirect', 'search_listings_meta');
    

    maybe its possible that bots are performing these searches but why only on the production site not on the stage site. and why does only when I perform like 3 or 4 searches then it keeps add the auto-generated strings?

    before the production site domain name was value******.com but now we changed it to durango**********.c* and we are facing this issue after changing the domain name before the plugin was working well even on the production site previous domain name.

    DK why this happening only on production site and only after changing the domain name.

    regards

    Junaid

    Thread Starter jasghar

    (@jasghar)

    okay, making your credentials BTW if you like can you come in a google meet or something you’re comfortable with so I can also be with you during the debugging process.

    Thanks

    Junaid

    • This reply was modified 1 year, 1 month ago by jasghar.
    Thread Starter jasghar

    (@jasghar)

    Hi @cornelraiu-1 thanks for your quick response. I tried and used HealthCheck and troubleshoot plugin and with troubleshoot mode active I deactivated all plugins and activated a default theme and deleted all search terms from db then tried to search on the website and after searching third time extra 3 auto generated strings were generated and stored in db. search terms like this

    toyota rav 4/service-and-parts/accessories/service-and-parts/accessories/blog/inventory

    you are right in mobile view the search bar is for a diffrent purpose its for filtering results in top-search results pages

    actually the thing is the website is in production server and i am only getting this issue in production website and not getting in stage site. if you can check the issue and can fix by today then i can give you a temporary access cause site is in production and in use and getting traffic. please tell me what user role you want to check the issue.

    Thanks for the support

    Junaid

    Thread Starter jasghar

    (@jasghar)

    @bcworkz I am returning huge html in the wp query calll which is the html of the post layout.
    and when i use json_encode it gives me error that the html is not a valid json

Viewing 15 replies - 1 through 15 (of 37 total)