> For the complete documentation index, see [llms.txt](https://developers.weglot.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.weglot.com/wordpress/use-cases/hide-button-on-excluded-page.md).

# Hide button on excluded page

Since the version 3.5 of Weglot plugin, the button is visible even is the page is excluded. Here is how to hide it on excluded page

Since version 3.5, the language button stays visible even on pages you excluded from translation. For example, if you excluded `/fr/contact`, the button still shows on both `/contact` and `/fr/contact`.

To hide the button on excluded pages:

```php
// Add this using the "Code Snippets" plugin or directly in functions.php
add_filter( 'weglot_button_html', 'weglot_button_hide', 10, 3 );
function weglot_button_hide( $html, $classes ) {
    $show_button = weglot_get_service( 'Request_Url_Service_Weglot' )->is_eligible_url( weglot_get_current_full_url() );
    if ( ! $show_button ) {
        return '';
    }
    return $html;
}
```
