Some websites attempt to prevent users from pasting text (i.e. Ctrl+V / Cmd+V) in web browsers.

It serves no purpose in most cases other than hindering accessibility and increasing annoyance for users.

It is relatively easy to bypass most trivial blocks with plain JavaScript. Open a DevTools console (Option + Cmd + I in Google Chrome on macOS), then paste in the following snippet:

function () {
  const forceEnableCopyPaste = (e) => {
    return true;

  ['paste', 'copy'].forEach(event => {
    document.addEventListener(event, forceEnableCopyPaste, true);

Bonus points: it also works for copying text.

I can see the point of trying to attempt to block copying (e.g. copyright, online exams), but there’s little reason to prevent pasting.

The only arguably valid use case I’ve seen to date for blocking pasting is in some sign-up forms wherein you need to type in some piece of user ID (e.g. your email, or your telephone number) twice. The second text field is sometimes blocked, as to encourage you to double check it is absolutely correct™, by the means of carefully typing it out.

The snippet above could also be easily converted to a bookmarklet.

Search for “bookmarklet builder” in your favorite search engine, go to a website such as, paste the above snippet therein, then get a compressed version such as:


Now just create a web browser favorite with that resource. Clicking the bookmark will yield the same effect as pasting the snippet into devtools.