Is it possible to change only Homepage URL in WordPress?

whitebee

Well-known member
Trusted Uploader
Dec 22, 2020
545
613
93
My sweet nest
babiato.tech
I think it's impossible. I tried it just now on localhost and it's gave me fatal error. LOL

But I guess you can setup multiple pages, name it "en", "es", "Jpn", etc. with different languages

set the wordpress default to en in "reading tab" as the static homepage, and if you have visitor from other country, lead them to other page with different language from the homepage.
 

whitebee

Well-known member
Trusted Uploader
Dec 22, 2020
545
613
93
My sweet nest
babiato.tech
It's actually possible to only redirect the homepage to page, using code like this in the function:

Code:
function redirect_homepage() {
    if( ! is_home() && ! is_front_page() )
        return;

    wp_redirect( 'https://yourWP.com/en/', 301 );
    exit;
}

add_action( 'template_redirect', 'redirect_homepage' );

And when people access that page, just set it as a homepage within your builder/theme ability. So it will display blog posts, archives, etc. I tried in localhost and it worked. People will never be able to access the real homepage without the "en" though...
 
Last edited:

shezzy2015

Active member
Mar 4, 2019
145
186
43
It's actually possible to only redirect the homepage to page, using code like this in the function:

Code:
function redirect_homepage() {
    if( ! is_home() && ! is_front_page() )
        return;

    wp_redirect( 'https://yourWP.com/en/', 301 );
    exit;
}

add_action( 'template_redirect', 'redirect_homepage' );

And when people access that page, just set it as a homepage within your builder/theme ability. So it will display blog posts, archives, etc. I tried in localhost and it worked. People will never be able to access the real homepage without the "en" though...
Thank you for giving me your precious time with detailed explanation.
 

Indiweb

Well-known member
Babiato Lover
Trusted Seller
Oct 13, 2018
683
305
63
Heart
Just create home page named en .... and do not set static page as home page in settings. Now use this home page link use in menu bar and in logo also... then home link will show /en ...
 

boYg

Well-known member
Banned User
Sep 15, 2019
315
327
63
This is a simple redirect issue. How to acheive it.

1. Create the page (eg: /en)
2. Set the homepage to any different page at the settings area.
3. Redirect homepage to the /en page.

If you get redirect loops kindly check and make sure you didn't do the redirects more than ones.

Let's know when it works. Enjoy.
 
  • Like
Reactions: shezzy2015

shezzy2015

Active member
Mar 4, 2019
145
186
43
Yes, it's possible with redirects, but redirects are a very bad idea if not absolutely necessary. So, I wonder why you would want this.
Because my homepage is removed from Google but others posts and pages are indexing properly.

I want to know if i redirect homepage to en/ then is it good in the eye of Google in terms of SEO.
 

shezzy2015

Active member
Mar 4, 2019
145
186
43
It's actually possible to only redirect the homepage to page, using code like this in the function:

Code:
function redirect_homepage() {
    if( ! is_home() && ! is_front_page() )
        return;

    wp_redirect( 'https://yourWP.com/en/', 301 );
    exit;
}

add_action( 'template_redirect', 'redirect_homepage' );

And when people access that page, just set it as a homepage within your builder/theme ability. So it will display blog posts, archives, etc. I tried in localhost and it worked. People will never be able to access the real homepage without the "en" though...
Yes, This works like a charm. Thank you buddy but i want to know that is it safe for SEO?
 
  • Like
Reactions: whitebee

whitebee

Well-known member
Trusted Uploader
Dec 22, 2020
545
613
93
My sweet nest
babiato.tech
Yes, This works like a charm. Thank you buddy but i want to know that is it safe for SEO?

I'm not SEO expert so I can't give you any definite answer 😅
but I think it won't be a problem, as it's 301 redirection, it would be assumed you've permanently change address and will pass all the link juices to the new address.
 
  • Like
Reactions: guguk

frizzel

Well-known member
Trusted Uploader
Jun 13, 2019
485
253
63
Wherever my imagination takes me
Because my homepage is removed from Google but others posts and pages are indexing properly.

I want to know if i redirect homepage to en/ then is it good in the eye of Google in terms of SEO.
Then I would first investigate why it was removed and remedy that instead of this redirect "band aid". Because, if Google has removed your Home Page for a legitimate reason and detects you're trying to circumvent that, you risk to loose indexing for your entire site.

Don't try to be 'more clever' than Google, just don't.
 

shezzy2015

Active member
Mar 4, 2019
145
186
43
Then I would first investigate why it was removed and remedy that instead of this redirect "band aid". Because, if Google has removed your Home Page for a legitimate reason and detects you're trying to circumvent that, you risk to loose indexing for your entire site.

Don't try to be 'more clever' than Google, just don't.
Sorry for inconvenient but i forgot to mention that my homepage was removed due to DMCA complain by someone not directly by Google.

Will it safe now to do that?
 

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu