Enable Classic Widget in WordPress in 2022

I am used to classic widgets and classic editors in WordPress. When a new update of WordPress came, it came with a block editor and widget.
This made my work a bit confusing and found a solution to change from the block editor to a classic editor.

Step 1: First of all go to your dashboard and on the left side of the panel hover your mouse on Appearance.

Step 2: Click on Theme File Editor.

Step 3: You might be given a warning that changing the files might crash your website. If you are not familiar with WordPress codes please don’t mess up other code.

Step 4: On the right side of the Themes file list select and click functions.php.

Step 5: In the file right after <?php past the following code

  // Disables the block editor from managing widgets in the Gutenberg plugin. the classic editor only
add_filter( 'gutenberg_use_widgets_block_editor', '__return_false' );
// Disables the block editor from managing widgets.
add_filter( 'use_widgets_block_editor', '__return_false' );


Step 6: After pasting this code click on Update files. Your file will be updated.

Now If you go to the widgets section you will see the classic widget and the block widget will be gone.
Hola! these are the simple steps that can save your time.