In Wp-login.php, when I entered a command to rewrite the domain of the login page to a new domain, an error occurred. After that, even if the command is deleted, the error remains. I think you might have panicked and tampered with some other description, so you can see the corrections here. Thank you very much.


Citation text
  <? php
  / **

  • WordPress User Page
  • Handles authentication, registering, resetting passwords, forgot password,
  • and other user handling.
  • @package WordPress

/** Make sure that the WordPress bootstrap has run before continuing. */
require (dirname (FILE).'/wp-load.php');

// Redirect to https login if forced to use SSL
if (force_ssl_admin ()&&! is_ssl ()) {
if (0 === strpos ($_ SERVER ['REQUEST_URI'],'http')) {
wp_safe_redirect (set_url_scheme ($_SERVER ['REQUEST_URI'],'https'));
exit ();
} else {
wp_safe_redirect ('https: //'. $_SERVER ['HTTP_HOST']. $_SERVER ['REQUEST_URI']);
exit ();


  • Output the login page header.
  • @param string $title Optional. WordPress login Page title to display in the<title>element.
  • Default'Log In&apos ;.
  • @param string $message Optional. Message to display in header.Default empty.
  • @param WP_Error $wp_error Optional. The error to pass. Default empty.
    function login_he ...
  • Answer # 1

    RewritingWp-login.phpto change the domain is usuallynever, so it should be restored from a backup. It is recommended.

    [Change site URL-WordPress Codex Japanese version]

    Please replace the URL in the DB by using a tool. (Although there are articles such as SQL in bulk, it may not work)

    [Note when you want to change the domain of the WordPress site. Rewrite URL in database]

    【Bulk replace URLs directly with SQL when migrating to WordPress! Use "Search and Replace for WordPress Databases Script" | infoScoop Developer Blog]

  • Answer # 2

    Download the WordPress source code from

    https://en.wordpress.org/download/ and extract wp-login.php from the distribution.

    Download the program WinMerge from

    http://www.geocities.co.jp/SiliconValley-SanJose/8165/winmerge.html. WinMerge is a Windows program, so if you are using a Mac, get a similar application separately.

    Compare the edited wp-login.php with the downloaded wp-login.php using WinMerge.