Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
Copa WPB
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Guia para iniciantes sobre a estrutura de arquivos e diretórios do WordPress

Nota editorial: Ganhamos uma comissão de links de parceiros no WPBeginner. As comissões não afetam as opiniões ou avaliações de nossos editores. Saiba mais sobre Processo editorial.

Deseja aprender sobre os arquivos e a estrutura de diretórios do WordPress?

Todos os principais arquivos, temas, plug-ins e uploads de usuários do WordPress são armazenados no servidor de hospedagem do seu site.

Neste guia para iniciantes, explicaremos a estrutura de arquivos e diretórios do WordPress.

WordPress file and directory structure explained for beginners

Por que você deve aprender sobre a estrutura de arquivos e diretórios do WordPress?

A maioria dos usuários pode executar seu site WordPress sem nunca aprender sobre arquivos ou diretórios do WordPress. No entanto, entender como o WordPress armazena arquivos e diretórios pode ajudá-lo a resolver muitos problemas comuns do WordPress por conta própria.

Este guia o ajudará:

  • Saiba quais arquivos e pastas do WordPress são arquivos principais.
  • Entenda como o WordPress armazena suas imagens e uploads de mídia.
  • Onde o WordPress armazena seus temas e plug-ins.
  • Onde os arquivos de configuração são armazenados em sua instalação do WordPress.

Essas informações também o ajudam a saber como o WordPress funciona nos bastidores e quais arquivos do WordPress você deve fazer backup.

Dito isso, vamos dar uma olhada na estrutura de arquivos e diretórios do WordPress.

Acesso a arquivos e diretórios do WordPress

Seus arquivos e diretórios do WordPress são armazenados no seu servidor de hospedagem na Web. Você pode acessar esses arquivos usando um cliente FTP. Consulte nosso guia sobre como usar o FTP para carregar arquivos do WordPress para obter instruções detalhadas.

Uma alternativa mais fácil ao FTP é o aplicativo Gerenciador de arquivos que vem incorporado na maioria dos painéis de controle de hospedagem do WordPress.

File manager app in hosting control panel

Depois de se conectar ao site do WordPress usando o FTP ou o Gerenciador de arquivos, você verá uma estrutura de arquivos e diretórios semelhante a esta:

WordPress files and folders

Dentro da pasta raiz, você verá os principais arquivos e pastas do WordPress. Esses são os arquivos e pastas que executam seu site WordPress.

Além dos arquivos .htaccess e wp-config.php, você não deve editar outros arquivos por conta própria.

Aqui está uma lista dos principais arquivos e pastas do WordPress que você veria no diretório raiz do seu site WordPress.

  • wp-admin [dir]
  • wp-content [dir]
  • wp-includes [dir]
  • index.php
  • license.txt
  • readme.html
  • wp-activate.php
  • wp-blog-header.php
  • wp-comments-post.php
  • wp-config-sample.php
  • wp-cron.php
  • wp-links-opml.php
  • wp-load.php
  • wp-login.php
  • wp-mail.php
  • wp-settings.php
  • wp-signup.php
  • wp-trackback.php
  • xmlrpc.php

Na lista acima, estão faltando os arquivos .htaccess e wp-config.php. Isso ocorre porque esses dois arquivos são criados após a instalação do WordPress.

Arquivos de configuração do WordPress

Seu diretório raiz do WordPress contém alguns arquivos de configuração especiais. Esses arquivos contêm configurações importantes específicas para seu site WordPress.

WordPress configuration files
  • .htaccess – Um arquivo de configuração do servidor, o WordPress o utiliza para gerenciar permalinks e redirecionamentos.
  • wp-config.php – Esse arquivo informa ao WordPress como se conectar ao seu banco de dados. Ele também define algumas configurações globais para seu site WordPress.
  • index.php – O arquivo de índice basicamente carrega e inicializa todos os seus arquivos do WordPress quando uma página é solicitada por um usuário.

Às vezes, pode ser necessário editar o arquivo wp-config.php ou .htaccess. Tenha muito cuidado ao editar esses dois arquivos. Um pequeno erro pode tornar seu site inacessível. Ao editar esses dois arquivos, sempre crie cópias de backup em seu computador antes de fazer qualquer alteração.

Se você não vir o arquivo .htaccess no diretório raiz, consulte nosso guia sobre por que não é possível encontrar o arquivo .htaccess no diretório raiz do WordPress.

Dependendo de como seu site WordPress está configurado, você pode ou não ter os seguintes arquivos no diretório raiz.

  • robots.txt – contém instruções para os rastreadores dos mecanismos de pesquisa
  • Favicon.ico – Um arquivo favicon às vezes é gerado por hosts do WordPress.

Dentro da pasta wp-content

O WordPress armazena todos os uploads, plugins e temas na pasta wp-content.

WordPress content folder

Em geral, supõe-se que você pode editar arquivos e pastas dentro da pasta wp-content. No entanto, isso não é totalmente verdade.

Vamos dar uma olhada na pasta wp-content para entender como ela funciona e o que você pode fazer aqui.

Inside wp-content folder

O conteúdo da pasta wp-content pode variar de um site WordPress para outro. Mas todos os sites do WordPress geralmente têm isso:

  • [dir] temas
  • [dir] plugins
  • [dir] uploads
  • index.php

O WordPress armazena seus arquivos de tema na pasta /wp-content/themes/. Você pode editar um arquivo de tema, mas isso geralmente não é recomendado. Assim que você atualizar o tema para uma versão mais recente, suas alterações serão substituídas durante a atualização.

É por isso que é recomendável criar um tema filho para a personalização do tema do WordPress.

Todos os plug-ins do WordPress que você baixa e instala em seu site são armazenados na pasta /wp-content/plugins/. Você não deve editar os arquivos de plug-in diretamente, a menos que tenha criado um plug-in do WordPress específico do site para seu próprio uso.

Em muitos tutoriais do WordPress, você verá trechos de código que podem ser adicionados ao seu site do WordPress. Você pode adicionar código personalizado ao seu site do WordPress adicionando-o ao arquivo functions.php do seu tema filho ou criando um plug-in específico do site.

Porém, a maneira mais fácil e segura de adicionar código personalizado é usar um plugin de trechos de código como o WPCode. Para obter instruções passo a passo, consulte este guia sobre como adicionar facilmente códigos personalizados no WordPress.

O WordPress armazena todos os seus uploads de imagem e mídia na pasta /wp-content/uploads/. Por padrão, os uploads são organizados nas pastas /year/month/ . Sempre que estiver criando um backup do WordPress, você deve incluir a pasta de uploads.

Você pode fazer o download de cópias novas do núcleo do WordPress, do tema e dos plugins instalados a partir de suas fontes. Mas se você perder sua pasta de uploads, será muito difícil restaurá-la sem um backup.

Algumas outras pastas padrão que você pode ver em seu diretório wp-content.

Muitos plug-ins do WordPress também podem criar suas próprias pastas dentro da pasta wp-content para armazenar arquivos.

Alguns plug-ins do WordPress podem criar pastas dentro da pasta /wp-content/uploads/ para salvar os uploads do usuário. Por exemplo, esse site de demonstração tem pastas criadas pelos plug-ins Smash Balloon, WooCommerce, SeedProd e WPForms.

Plugins may create their own folders inside uploads directory

Algumas dessas pastas podem conter arquivos importantes. Por isso, recomendamos fazer o backup de todas essas pastas por precaução.

Outras pastas podem conter arquivos que você pode excluir com segurança. Por exemplo, seus plug-ins de cache, como o WPRocket, podem criar pastas para salvar dados de cache.

Esperamos que este artigo tenha ajudado você a entender a estrutura de arquivos e diretórios do WordPress. Talvez você também queira ver nosso guia para iniciantes sobre gerenciamento de banco de dados do WordPress com o phpMyAdmin e nosso tutorial sobre como criar um tema personalizado do WordPress sem nenhum conhecimento de programação.

Se você gostou deste artigo, inscreva-se em nosso canal do YouTube para receber tutoriais em vídeo sobre o WordPress. Você também pode nos encontrar no Twitter e no Facebook.

Divulgação: Nosso conteúdo é apoiado pelo leitor. Isso significa que, se você clicar em alguns de nossos links, poderemos receber uma comissão. Veja como o WPBeginner é financiado, por que isso é importante e como você pode nos apoiar. Aqui está nosso processo editorial.

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

O kit de ferramentas definitivo WordPress

Obtenha acesso GRATUITO ao nosso kit de ferramentas - uma coleção de produtos e recursos relacionados ao WordPress que todo profissional deve ter!

Reader Interactions

57 ComentáriosDeixe uma resposta

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Moinuddin Waheed says

    I have always fantasized about what goes behind the scene to run such a good wordpres front end and backend interface.
    This guide has cleared all those behind the scene aspect of wordpress working.
    Having a knowledge of these files and directories structure gives us command over tweaks that we can make.
    Thanks wpbeginner for this guide on wordpress file structure.

    • WPBeginner Support says

      It is almost the same, a multisite install would have folders for each of the subsites.

      Administrador

  3. Amit Maheshwari says

    Please help me on how can I create a folder inside my blog hoste on wordpress on my site. I want to create more subfolder under that like news, life etc to make sure my users get the content more organized?

  4. Kosovi says

    Getting this error: Fatal error: Call to undefined function wp() in XXXX\html\wp-blog-header.php on line 12. Tried several troubleshooting, but wont solve the issue. Stoped Theme, and pluggins.

  5. Bruno rasmussen says

    Hi
    Im getting the error message about a missing ads.txt file, i know where to find it, but im not sure where i have to insert it.

    Best regards
    Bruno
    Denmark

  6. J.Hameed says

    Am trying to upload an unzipped file to this location:

    wp-content/uploads/GeoLite2-Country.mmdb

    Question : How do I find the location and how do i upload the unzipped file to this location.

  7. John says

    Hi
    My website was hacked. it keeps redirecting me to a spammy site. I can’t log in via the backend (cos it keeps redirecting me to a spammy site) and I don’t have a backup of the site but I can still access my Cpanel but dont know what to do there, please any help will be appreciated.
    hemjaypost.com is the site

  8. Karen says

    Crazy question.
    After importing demo site content on an Avada themed site – there are so many pages I have NO IDEA how to get back to identify and edit my home page in the PAGES link? I now have 8 pages of “pages”. How can I find my Home page? BTW – In READINGS > SETTINGS – I’ve checked blog assigned to home page NOT to a STATIC Page. Many thanks!
    I have googled several ways – but can’t figure out this thing!

    • WPBeginner Support says

      Hi Karen,

      When you go to Pages » All Pages you should be able to see — Homepage label next to the page used as your homepage. You can also try reaching out to the theme developer for support.

      Administrador

  9. Mary Emerson says

    I, too, want to find where my old .htm files that are now encased in WordPress with different urls! I need to delete a bad xml file and I have to idea how to go to server and remove. I removed it permanently inside the page list, but I am afraid Bing is still thinking that is what I want submitted. It keeps saying it is not valid and I want to clear it out!
    Thank you!

  10. Lalit Kumar Yadav says

    hi
    i developed an custom post in woocommerce website. But after that i want to use an dynamic photo slider in this custom post, i tried a lot but failed to make it dynamic.please guide me about the use of page template and how to make slider dynamic.

  11. Ajju says

    Helpfull but i want edit a page outside without WordPress , by another html editer ,becouse i try to remove theme on some specific pages ,but not entier website

  12. JohnLeyo says

    thank you, that was very helpful… but i want to know if it is safe to replace all the wordpress core files by a new files?

  13. Ben says

    Hi there, I recently downloaded my old WordPress site onto my computer, and installed a new site on my domain. I am now trying to dig around and find all my blog posts from the old site so I can add them to the new site, any idea if thats possible and where I would find those? Thanks so much for your help.

  14. Hany Danial says

    what is the file name for the users in the wordpress? I have a complete backup for my site, moved it to another server, the number of the users were about 24K but now I found only 9K and I would like to restore the old one. Thanks in advance for your reply. Hany Danial

  15. Amit says

    Hi,

    Suppose if I want to change the look of the WordPress theme then which files are important or in which file do I need to change the code?

    Since last 2 years I am thinking to change the some little look of my theme but because of not fully understanding I couldn’t do it.

    Thanks,
    Amit

  16. tushar says

    Hi, thank you for this post I agree with you that An easier alternative to FTP is File Manager. It is a web-based application that comes built into cPanel dashboard of your WordPress hosting account. very useful information

  17. john says

    how to i change upload the pictures for the web site or upload the new coupon for the website that use WordPress or edit the content of the website?

    when I login to the FTP site, i see these 3 folders
    wp-admin
    wp-content
    wp-includes

    thanks
    john

      • john says

        thanks. the company who wrote the website did not transition to me. How do I request to reset the password to login to the admin page?

        also, i need to update just the coupons by update the new images of the coupons.

        also, how to i transfer the page_id=369 to the coupons page

        thanks again,
        John

  18. Ezeudo Emmanuel says

    great article. But I have a question though. I am a beginner and trying to design a website via wordpress. i have finished the design to an extent. but my problem is that when i try to upload my wordpress file via ftp (file zilla), i cant seem to find the file on my C:/. how to i locate my wordpress file? thank you as i await your response

  19. KAIZER MD AMIN says

    It is really helpful for me as I am just starting out with my blog and I have very little knowledge about these technical issues. Great content, thanks.

  20. fassaha says

    Great article! I do have a question though: Where do we actually find the articles that we wrote on the site? Let say I write an article on my site. This article is normally stored in wordpress files. where can I find it?
    Thanks

    • Henric Åkesson says

      Your article itself will not be stored in files, it will be stored in the database. Only your files will be stored inside the wp-content/uploads.

      Ok? :)

  21. ademola says

    please i need your help urgently, i want to restart my afresh. But i just need my articles and its images. i do not need anything else.The reason for this is that my hosting is saying someone is using my site to spam people using a business address i did not even add to my webmail. if i delete it they create another one. but now another issue is thta malware are been detected on the site. but i am using the newspaper theme so i do not know why all this issues. I can do all the installing of new wordpress and every other thing but i need to just put the contents i have on the new site i am going to create. i still have my old site on now and i have the backup in my file manager home directory.

  22. mimo says

    Thanks for the article….what about finding “pages” on the directory? i cant seem to find them…will they be accessible via cpanel or just in the wp interface? i see all the image files i uploaded on the [dir]uploads page, organized by month/year as you mentioned on the cpanel directory, but was wondering where i can find the actual Pages file/word content pages? thank you…

      • Buck Riley says

        So, there’s no way to get the contents of the page themselves through the FTP? Like, if I wanted to pull my about page from the FTP, I wouldn’t be able to do that?

        • Buck Riley says

          Or… is this databased stored elsewhere on the site outside of the wordpress folder, and having only backed up the wordpress folder when my site was deleted, I’ve lost all of my content?

        • WPBeginner Support says

          No, you will not be able to do that.

          WordPress does not create and store static pages. Instead, it stores your content in a database and then generates HTML pages on the fly.

        • Robert says

          “No, you will not be able to do that.

          WordPress does not create and store static pages. Instead,
          it stores your content in a database and then generates
          HTML pages on the fly.”

          After a WSOD and several hours of trying to get back to the dashboard, I deleted all WP files from my file mgr. Before I did that I backed up and stored all of those files in a temp file in file manager.

          Is there a way I can get my input (static pages) generated in html, so I may copy them?

          I am about ready to install another WP theme, but before I do so I hold a slim hope that these pages are still stored somewhere, like in an etheral world of some database.

        • Josh says

          Robert, I second your motion. The answer has been rather expertly skirted around here. Is there some kind of membership fee we need to pay for these kind of seemingly simple answers? All I can find is the import/export tool for the pages, then edit the CSS or delete the unnecessary pages as desired.

  23. Hemang Rindani says

    Nice article. For development team working with enterprise content management services like WordPress (or in that matter any other CMS like Sitefinity, Drupal, etc.) must understand the basic file structure. This will not only help them find the files but with this they will also be able to organize the files in proper way.
    Using a nested approach to save your content and system files is a the best way to design a file structure.

Deixe uma resposta

Obrigado por deixar um comentário. Lembre-se de que todos os comentários são moderados de acordo com nossos política de comentários, e seu endereço de e-mail NÃO será publicado. NÃO use palavras-chave no campo do nome. Vamos ter uma conversa pessoal e significativa.