General

How to remove URL/href when printing bootstrap website using jquery

By default in bootstrap, they have added a class for displaying href URL as content. We need to override that class with a custom CSS style. If you want to remove the entire body contents then please add the below code to your CSS. If you want to remove only the href inside a particular div then replace the body with the parent div’s class or id.

Note : You must need to add it inside print media query css

  a[href]:after {
    content: none !important;
  }

That’s all. You are ready to go.
Note: please clear your browser cache or check in incognito window.

You may also like...