Skip to content

Instantly share code, notes, and snippets.

@arafathusayn
Last active May 8, 2024 03:33
Show Gist options
  • Save arafathusayn/101a211b3d8122876d70cf1af04ae81d to your computer and use it in GitHub Desktop.
Save arafathusayn/101a211b3d8122876d70cf1af04ae81d to your computer and use it in GitHub Desktop.
Remove Tawk.to Branding (2022)
var removeBranding = function() {
try {
var element = document.querySelector("iframe[title*=chat]:nth-child(2)").contentDocument.querySelector(`a[class*=tawk-branding]`)
if (element) {
element.remove()
}
} catch (e) {}
}
var tick = 100
setInterval(removeBranding, tick)
@MACTECHWORLD
Copy link

Can you make a script to add our on branding in live chat

Copy link

ghost commented Sep 24, 2021

Thank you so much .... Love you bro

@nikola88888
Copy link

Works briefly and then the whole chat freezes. Anyway, thank you for your effort.

@nextvisionmx
Copy link

Awesome!

Thanks!

@dev-amdadul
Copy link

You have done a awesome job. Thank You
But now they are using another branding can you remove that for us please. @arafathusayn
Untitled

@juan5620
Copy link

Same here Works briefly and then the whole chat freezes.

@juan5620
Copy link

juan5620 commented Sep 1, 2022

definitely not working it makes the chat freeze after a couple of clicks

@garyfisher
Copy link

You have done a awesome job. Thank You But now they are using another branding can you remove that for us please. @arafathusayn Untitled

var removeBranding = function() {
    try {
        var element = document.querySelector("iframe[title*=chat]:nth-child(2)").contentDocument.querySelector(`a[class*=tawk-branding]`)
        var elementt = document.querySelector("iframe[title*=chat]:nth-child(2)").contentDocument.querySelector(`a[class*=tawk-button-small]`)
        if (element) {
            element.remove()
        }
        if (elementt) {
            elementt.remove()
        }
    } catch (e) {}
}

var tick = 100

setInterval(removeBranding, tick)

@zubairbd007
Copy link

how to add this code to plugin?please help

@HideCM
Copy link

HideCM commented Nov 24, 2022

How to remove POP OUT WIDGET, please?

@AndresReyesDev
Copy link

@HideCM No way to do that. The popup is located on the tawk domain.

@KarisKevoo
Copy link

worked fine for me, thenks

@chiangky
Copy link

sometime works perfectly, some time throw error... any ideas? thanks.
Untitled

@trinib
Copy link

trinib commented Oct 19, 2023

working in 2023 latest version

@jarrod0011
Copy link

Worked For Me!

Create a JavaScript file:
Create a new JavaScript file, for example, custom-script.js, and paste the above code into this file.

Upload the JavaScript file:
Upload the JavaScript file to your theme directory or another appropriate location in your WordPress installation.

Enqueue the script in your theme's functions.php:
Open your theme's functions.php file and add the following code to enqueue your script:

functions.php - code

function enqueue_custom_script() {
    wp_enqueue_script('custom-script', get_template_directory_uri() . '/path/to/custom-script.js', array(), '1.0', true);
}
add_action('wp_enqueue_scripts', 'enqueue_custom_script');

Make sure to replace /path/to/custom-script.js with the actual path to your JavaScript file.

Save and update:
Save the changes to your functions.php file and update your WordPress theme.

Now, your JavaScript code will be included and executed on the client side when the website is loaded.

@lswang6
Copy link

lswang6 commented May 8, 2024

not working properly in 0.8.2 plugin (2024 verison), sometimes the layout of the chat interface is offset, and can not show chat window properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment