If you want code for redirection in wordpress, you can easily redirect without using any plugin in wordpress.
There are many plugins in wordpress for 301 redirection. but using plugin have some benefits as well as drowbacks.
You can use famous plugin Redirection.
WIth the help of above plugin you can redirect any page of wordpress to other page as 301 permanant redirect.
But if you dont want to use any plugin as plugin can spread malwares are that can affect the loading time of wordpress website. here is simple code for redirecing the wordpress url to any other page with simple Htaccess code change.
Here is the code sample you can use for redirecting the url with htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
Redirect 301 /OLD URL NEWURL
</IfModule>
# END WordPress
Eaxmple :
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Redirect 301 /tag/seo-classes-in-nagpur/ https://www.adityainfo.co.in/coaching/seo-digital-marketing-nagpur/
</IfModule>
# END WordPress