• I installed WordPress in to folder named /wp2017. I edited the Site Address by removing the /wp2017 folder from the end of the address. People can now find my site as though WordPress had been installed in the root folder. However, the URL of my uploaded image files still shows /wp2017 in the path. In the Page Source, the URL to style sheets and embedded images show the /wp2017 folder in the path. Therefore, I am not really hiding the identity of the installation folder.

    How do I remove all references to the /wp2017 folder from these paths? Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Have you replace all the sql entries with new URL?

    Run following sql queries. Replace yoursite.com with your actual site name

    UPDATE wp_options SET option_value = REPLACE(option_value, 'http://yoursite.com/wp2017', 'https://yoursite.com') WHERE option_name = 'home' OR option_name = 'siteurl';
    UPDATE wp_posts SET post_content = REPLACE (post_content, 'http://yoursite.com/wp2017', 'https://yoursite.com');
    UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, 'http://yoursite.com/wp2017','https://yoursite.com');
    UPDATE wp_comments SET comment_content = REPLACE (comment_content, 'http://yoursite.com/wp2017', 'https://yoursite.com');
    UPDATE wp_comments SET comment_author_url = REPLACE (comment_author_url, 'http://yoursite.com/wp2017','https://yoursite.com');
    UPDATE wp_posts SET guid = REPLACE (guid, 'http://yoursite.com/wp2017', 'https://yoursite.com') WHERE post_type = 'attachment';
    

    Refer this site for detail.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    1. See https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory
    2. The queries above may break your site. Do not execute them. Use the plugin “better search replace”, the Interconnect script, or wp-cli’s search-replace tool.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove installation subfolder from file paths’ is closed to new replies.