{"id":5985,"date":"2024-08-05T08:43:51","date_gmt":"2024-08-05T08:43:51","guid":{"rendered":"https:\/\/halkoo.com\/?p=5985"},"modified":"2024-11-08T13:39:49","modified_gmt":"2024-11-08T13:39:49","slug":"impostare-un-redirect-a-una-pagina-personalizzata-dopo-il-login-in-wordpress","status":"publish","type":"post","link":"https:\/\/halkoo.com\/en\/setting-a-redirect-to-a-customised-page-after-login-in-wordpress\/","title":{"rendered":"Setting a redirect to a customised page after login in WordPress"},"content":{"rendered":"<p class=\"wp-block-paragraph\">Logging in in WordPress is a common operation for website users. However, it is often necessary to perform specific actions after login, such as redirecting the user to a customised page. In this article, we will guide you step by step on how to insert a code snippet in WordPress to perform a redirect to a customised page after login in the frontend.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 1: Create a custom function<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Enter the following code in the file <code>functions.php<\/code> of your theme or plugin:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/**\n * Snippet Name: Redirect after login to homepage\n * Snippet Author: halkoo.com\n *\/\nadd_action( 'woocommerce_login_form_end', 'loginpress_woocommerce_actual_referrer' );\n\nfunction loginpress_woocommerce_actual_referrer() {\necho '';\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 3: Save changes<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Save changes made to the file <code>functions.php<\/code>. If you modified the file via FTP, be sure to save the changes and reset the file permissions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 4: Test the redirect<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Try logging in with a user's credentials and check whether the website is redirected to the customised page specified in the snippet.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Need help? Write to <a href=\"mailto:info@halkoo.com\">info@halkoo.com<\/a> to receive a customised quote for your new website or e-commerce shop.<\/p>","protected":false},"excerpt":{"rendered":"<p>Il login in WordPress \u00e8 un&#8217;operazione comune per gli utenti di un sito web. Tuttavia, spesso \u00e8 necessario eseguire azioni specifiche dopo [&hellip;]<\/p>","protected":false},"author":1,"featured_media":5988,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[54],"tags":[72,71,47],"class_list":["post-5985","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","tag-login","tag-redirect","tag-wordpress"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/halkoo.com\/en\/wp-json\/wp\/v2\/posts\/5985","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/halkoo.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/halkoo.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/halkoo.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/halkoo.com\/en\/wp-json\/wp\/v2\/comments?post=5985"}],"version-history":[{"count":0,"href":"https:\/\/halkoo.com\/en\/wp-json\/wp\/v2\/posts\/5985\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/halkoo.com\/en\/wp-json\/wp\/v2\/media\/5988"}],"wp:attachment":[{"href":"https:\/\/halkoo.com\/en\/wp-json\/wp\/v2\/media?parent=5985"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/halkoo.com\/en\/wp-json\/wp\/v2\/categories?post=5985"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/halkoo.com\/en\/wp-json\/wp\/v2\/tags?post=5985"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}