• Hi, I’m venturing into WordPress development after several years of building sites using themes.
    One question I have is about robots.txt. When I search, I get answers that WordPress creates a Virtual robots.txt file.
    I understand that by definition, a virtual file is not a physical file. In the context of WordPress, what is a virtual file? And why does WordPress create a virtual robots.txt instead of a physical file.
    Thanks in advance

    • This topic was modified 5 years, 5 months ago by sansolo. Reason: classified as not support question
Viewing 2 replies - 1 through 2 (of 2 total)
  • Like all of the pages of a WordPress site, the robots.txt file is generated upon request. They are all virtual files instead of physical files, so that they can be changed easily.
    For robots.txt, there is a do_action( 'do_robots' ); in the template-loader.php file. Plugins can put whatever is needed in the “file” by adding an action.

    Thread Starter sansolo

    (@sansolo)

    @joyously thanks a ton!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Virtual Robots.txt’ is closed to new replies.