• Resolved jasghar

    (@jasghar)


    Hi @cornelraiu, I hope you are well.

    Thanks for the great support you provided in my previous ticket. I’ve one more question.

    as you can see in the image this search is made from finland but it looks a spammy search. is there any way I can prevent these searches as well?

    I’ve already used your provided regex pattern to prevent automated generated searches and its working well.

    P.S: Is there any way I can only show the searches with a specific number of letters in them.

    means I’ve 10 searches in total and 5 of them is 10 characters long while other 5 of them are only 6 characters long so I only want to show the search terms 6 characters long. I know this is easily implementable using JS but still checking if this is something available.

    Thanks

    Junaid

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Cornel Raiu

    (@cornelraiu-1)

    Hi,

    I can’t see the image you added. Please upload it to an image sharing service and then share the link.

    You can filter out the searches using the filter and function we added on the other ticket. However, there’s no built in spam filter functionality. You would have to apply the filters as you see fit.

    For the character limit, you should be able to filter the results via PHP when pulling the results from the database. Not sure if you are using the built-in shortcodes or something custom, but it should be pretty easy.

    Let me know if I can help with anything else.

    Thank you,

    Cornel Raiu

    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)

    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

    Plugin Author Cornel Raiu

    (@cornelraiu-1)

    Hi,

    You don’t need the \ before the words. The \ is only for escaping characters that would break the RegEx. So, you can just add the words comma separated in that field. Make sure you don’t have a trailing comma.

    For the second question, you can add the same code you have on search to exclude the strings from being stored and then programatically save the other search term in the db.

    You can use the mwtsa_extra_exclude_conditions or mwtsa_exclude_term to exclude the term.

    Alternatively, in case you are only using the standard search param ( s= ) you may use the get_search_query filter that WordPress provides and change the search string before it’s being processed by WP Search Analytics.

    I will release an update in the last week of October that will add some more filters, one of them will be similar to get_search_query that will allow to update the search string before being saved in the database. That way you’ll be able to filter the 18+ words exactly as you do with the results.

    I hope this answers your questions.

    Thank you,
    Cornel Raiu

    Plugin Author Cornel Raiu

    (@cornelraiu-1)

    Hi,

    I will close this thread for lack of activity.
    In case you still have questions, please start another thread.

    Thank you,
    Cornel Raiu

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to prevent spammy searches’ is closed to new replies.