How to remove /wp or other folder name in URL when searching for your website?

  1. Login to cPanel and go to File Manager.
  2. On the right side under File Manager, click Settings and check "Show Hidden Files (dotfiles)" and click Save.

    • This must be enabled for you to check the .htaccess which must be edited in order to complete the task.

  3. Go to public_html or where the web files are but not inside the folder in where your Wordpress files.(sample Wordpress file: wp-config.php) Please check this link for your reference(https://prnt.sc/im4x8e)
  4. To add a file, on the upper left side under File Manager, click "File" to add an index.php and click "create new file". Repeat the process for the .htaccess file if there is none.
  5. To add the default code for index.php, press right click on your mouse to index.php file, click Edit and once the loading page is done, click the Edit again.
  6. Input the following code which is the default for index.php and save once done. Note: if the name of the folder is not "wp", just replace it with the correct folder name.

    <?php
    /**
     * Front to the WordPress application. This file doesn't do anything, but loads
     * wp-blog-header.php which does and tells WordPress to load the theme.
     *
     * @package WordPress
     */
    
    /**
     * Tells WordPress to load the WordPress theme and output it.
     *
     * @var bool
     */
    define('WP_USE_THEMES', true);
    
    /** Loads the WordPress Environment and Template */
    require( dirname( __FILE__ ) . '/wp/wp-blog-header.php' );
  7. Now, input the following code for the default .htaccess and save once done.

    # 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]
    </IfModule>
    
    # END WordPress
  8. After inputting those codes to index.php and .htaccess, open the folder where the Wordpress files are. Please check this link for a sample.(https://prnt.sc/im4yx9) Note: in this case, it is under wp folder. 
  9. Repeat the step 6 but instead of adding, you can add the "/wp" before "/wp-blog-header.php" or you can also delete it and copy the code on step 6.
  10. For .htaccess inside the wp folder, you must replace it with the following code and save.

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /wp/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wp/index.php [L]
    </IfModule>
    
    # END WordPress
  11. The last step is removing the link for home URL set in General Settings. Instead of http://yourdomain.com/wp it must be http://yourdomain.com Note: please check this link for reference.(https://prnt.sc/im542g)
  12. It can also be done under PHPMYADMIN which where the database can be managed. But you must at least a basic knowledge of it before taking actions. 
  • 133 Users Found This Useful
Was this answer helpful?

Related Articles

Adding an Image

 1. Click the icon Add Image beside Upload/Insert 2.  Browse for the image...

WYSIWYG buttons

1. This space is where you would insert your title; this is the title that displays in your...

Commonly Used Terms

Title The title of your post. You can use any words or phrases. Avoid using the same title...

How to add PDF file download link?

1. Go to Media > Add New. Upload the PDF File.2. Click Edit under the PDF file you’ve...

How to restore my admin password?

1. Click Lost your password link.2. Enter your email address.3. Go to your email account and look...