WordPress.org

Ready to get started?Download WordPress

Codex

pt-br:FAQ Resolvendo Problemas

Contents

Encontre mais ajuda

Fórum Oficial do WordPress Brasil É composto por voluntários com vários níveis de experiência.

Botão "Salvar Alterações" não aparece

Aparentemente um problema no php.ini que o serviço adiciona automaticamente no exemplo de serviços como Locaweb e UOLHost. Observado no tópico: [1].

Problema:

(...)No entanto, no meu painel de Configurações Gerais, não existe o botão "Salvar alterações". Pra várias opções de outras configurações, o botão tá lá; mas pro Configurações Gerais, não.

Solução:

As diretivas de PHP não estavam sendo inicializadas na minha revenda. A única coisa que eu tive que fazer, como instruído pelo atendimento, foi renomear o php-cgi.ini pra php.ini. Isso resolveu outros problemas menores que eu tava tendo no Wordpress, também, com o buffer de memória (faz sentido agora).
O atendimento explicou que a mudança foi feita internamente lá (tirar o -cgi), mas que estavam esperando os clientes reportarem problemas pra ver se ia ser necessário renomear o arquivo(...)

Enfim, diretivas de PHP aplicadas, problema resolvido.[2]

Problema:

Mesmo definindo a permissão para wp-content em 777, não consigo editar os arquivos do tema ou dos plugins.

Solução É preciso definir a permissão em TODOS os arquivos DENTRO da pasta, não apenas para a pasta.

Por que não vejo minhas postagens? Tudo o que vejo é Sorry, no posts match your criteria?

Limpe o cache do seu navegador. Veja também os arquivos search.php e index.php do seu tema.

Como saber em qual Banco de Dados meu Wordpress está instalado?

  1. Acesse a sua área de Hospedagem, através de FTP ou Gerenciador de Arquivos.
  2. Navegue até a pasta na qual o WordPress foi instalado.
  3. Faça o Download do arquivo wp-config.php
  4. As informações podem ser encontradas nas primeiras linhas do arquivo wp-config.php :
define('DB_NAME', 'nome_do_banco');
define('DB_USER', 'usuario');
define('DB_PASSWORD', 'senha');
define('DB_HOST', 'mysql06.seudominio.tld');

Por que o WordPress não está enviando emails no Windows?

O WordPress, assim como outros aplicativos Web feitos em PHP, utiliza uma biblioteca chamada PHPMailer para realizar os envios de email através do do serviço de SMTP do servidor no qual está hospedado.

4. Esta biblioteca, originalmente, possui uma incompatibilidade com servidores Windows, o que causa o problema no envio de mensagens.

Solução

Caso você tenha instalado o WP por conta própria ou tenha atualizado automaticamente a sua versão para a mais recente, você pode seguir os seguintes passos para solucionar o problema.

1. Localize o arquivo wp-includes\class-phpmailer.php 2. Abra o arquivo e navegue até a linha com o seguinte código:

var $LE              = "\n";

3. Altere o conteúdo desta linha para:

var $LE              = "\r\n";

4. Localize o seguinte conteúdo:

function AddrFormat($addr) {
  if(empty($addr[1])) {
    $formatted = $this->SecureHeader($addr[0]);
  } else {
    $formatted = $this->EncodeHeader($this->SecureHeader($addr[1]), 'phrase') . " <" .  $this->SecureHeader($addr[0]) . ">";
  }
  return $formatted;
}

5.Altere o conteúdo da função acima para:

function AddrFormat($addr) {
  return $this->SecureHeader($addr[0]); }

Pronto, isso deve fazer com que o envio de emails seja normalizado.

Why does the password emailed to me look weird?

If the password emailed to you looks strange, see Solving Garbled Text.

Why do I get an error message about Sending Referrers?

If you got this message when trying to save a post, consider checking Administration > Settings > General and make sure both your WordPress address (URI) and the Blog address (URI) do not use 'www'. For example, instead of http://www.sample.com use http://sample.com in those fields. This information originally reported via http://wordpress.org/support/topic/72235

See also:

Are there are any problems with using MySQL 4.1.7 for WordPress?

See Can I install WordPress on Windows 2000?

How do I empty a database table?

See also:

How do I fix the following error SQL/DB Error errcode 13 Can't create/write to file?

Problem: The MySQL variable tmpdir is set to a directory that cannot be written to when using PHP to access MySQL.

To verify this, enter MySQL at the command line and type show variables;

You'll get a long list and one of them will read: tmpdir = /somedir/ (whatever your setting is.)

Solution: Alter the tmpdir variable to point to a writable directory.

Steps:

  1. Find the my.cnf file. On *nix systems this is usually in /etc/.
  2. Once found, open this in a simple text editor and find the [mysqld] section.
  3. Under this section, find the tmpdir line. If this line is commented (has a # at the start), delete the # and edit the line so that it reads: tmpdir = /writable/dir where /writable/dir is a directory to which you can write. Some use /tmp, or you might also try /home//.
  4. Save the file.
  5. Shutdown MySQL by typing mysqlshutdown -u -p shutdown.
  6. Start MySQL by going to the MySQL directory and typing ./bin/safe_mysqld &. Usually the MySQL directory is in /usr/local or sometimes in /usr/ on Linux systems.

If none of this make sense and you have someone to administrate your system for you, show the above to them and they should be able to figure it out.

Problema Headers already sent

Problema Ao acessar qualquer página, obtém a mensagem:

Warning: Cannot modify header information - headers already sent by (output started at

Razões e SOluções:

Geralmente é porque há espaços, quebras de linhas no final do arquivo, coisas como pedaços de tags de fechamento no arquivo wp-config.php.

Isso pode ser verdadeiro sobre algum outro arquivo também, portanto, verifique a mensagem de erro, ela pode informar o nome de arquivo específico onde ocorreu o erro (ver "Interpretando a mensagem de erro" logo abaixo). Substituindo o arquivo defeituoso por um de seu backup mais recente ou um de um download WordPress novo é uma boa idéia também, mas se nenhum desses podem ser feitos, siga os passos abaixo.

Só porque você não consegue ver nada, não significa que o PHP vê o mesmo.

  1. Download the file mentioned in the error message.
  2. Open that file in a plain text editor (NOT MS Word or similar. Notepad or BBEdit are fine).
  3. Check that the very first characters are <?php
  4. Check that the very last characters are ?>

To be sure about the end of the file, do this:

  1. Place the cursor between the ? and >
  2. Now press the DELETE key on your computer
    • Note to MAC users: The "DELETE" key on a PC deletes characters to the right of the cursor. That is the key noted here.
  3. Keep that key pressed
  4. For at least 15 seconds
  5. Now type > and
  6. save without pressing any other key at all.
  7. If you press another key, you will bring the problem back.

Also check the encoding of the file. If the file is encoded as UTF-8 with BOM, the BOM is seen as a character which starts the output.

Interpretando a mensagem de erro

If the error message states: Warning: Cannot modify header information - headers already sent by (output started at /path/blog/wp-config.php:34) in /path/blog/wp-login.php on line 42, then the problem is at line #34 of wp-config.php, not line #42 of wp-login.php. In this scenario, line #42 of wp-login.php is the victim. It is being affected by the excess whitespace at line #34 of wp-config.php.

If the error message states: Warning: Cannot modify header information - headers already sent by (output started at /path/wp-admin/admin-header.php:8) in /path/wp-admin/post.php on line 569, then the problem is at line #8 of admin-header.php, not line #569 of post.php. In this scenario, line #569 of post.php is the victim. It is being affected by the excess whitespace at line #8 of admin-header.php.

Other issues that might cause that error:

In case you've used the function: wp_redirect() or tried to use a header redirect after the header (or any content at all was sent) that error message will pop. Instead use javascript redirection if needed.

Why can't I see the visual rich editor when using Apple's Safari browser?

Description: The visual rich editor in the Write interface (aka "the WYSIWYG editor") does not display when using Apple's Safari browser.

Reason and Solution: In early versions of Safari, the visual rich editor would cause the browser to crash immediately upon loading the Write interface. This was due to a bug in Safari, not WordPress. Since the WordPress developers had no way of correcting this, they chose to disable the visual rich editor for Safari users. At this point in time, there are three alternatives for affected users. One could upgrade to Safari 3.0.4 or higher and WordPress 2.3 or higher, use Firefox or Camino, or de-select "Users should use the visual rich editor by default" in Administration > Settings > Writing and install Dean's FCKEditor For WordPress.

Why can't I see the Quicktag buttons when using Apple's Safari browser?

Description: The Quicktag buttons in the Write interface do not display when using Apple's Safari browser.

Reason and Solution: In early versions of Safari, the Quicktag buttons would function, but not as intended. This was due to a bug in Safari, not WordPress. Since the WordPress developers had no way of correcting this, they chose to disable the Quicktag buttons for Safari users. At this point in time, there are three alternatives for affected users. One could upgrade to Safari 2.0.4 or higher and WordPress 2.0.7 or higher, use Firefox or Camino, or (for earlier versions of WordPress) remove the if statement on line 1085 and the word "else" on line 1092 of /wp-admin/admin-functions.php .

For example, change this:

function the_quicktags() {
	// Browser detection sucks, but until Safari supports the JS needed for this to work people just assume it's a bug in WP
	if (!strstr($_SERVER['HTTP_USER_AGENT'], 'Safari'))
		echo '
		<div id="quicktags">
			<script src="../wp-includes/js/quicktags.js" type="text/javascript"></script>
			<script type="text/javascript">if ( typeof tinyMCE == "undefined" || tinyMCE.configs.length < 1 ) edToolbar();</script>
		</div>
';
	else echo '
<script type="text/javascript">

to this:

function the_quicktags() {
	// Browser detection sucks, but until Safari supports the JS needed for this to work people just assume it's a bug in WP
		echo '
		<div id="quicktags">
			<script src="../wp-includes/js/quicktags.js" type="text/javascript"></script>
			<script type="text/javascript">if ( typeof tinyMCE == "undefined" || tinyMCE.configs.length < 1 ) edToolbar();</script>
		</div>
';
		echo '
<script type="text/javascript">

E-mailed passwords are not being received

Description: When users try to register with your blog or change their passwords by entering their username and email, WordPress indicates that their password has been emailed to them, but it is never received.

Reason and Solution: WordPress uses the standard php mail function, which uses sendmail. No account information is needed. This is not generally a problem if you are using a hosting service, but if you are using your own box and do not have an SMTP server, the mail will never send. If you are using a *NIX box, you should have either postfix or sendmail on your machine; you will just need to set them up (Google for how-to's). If you do not want to go through setting up a complete mail server on your *NIX box you may find ssmtp useful -- it provides "A secure, effective and simple way of getting mail off a system to your mail hub". On a Windows machine, try a sendmail emulator like Glob SendMail.

More help can be found on the forums at: http://wordpress.org/support/topic.php?id=24981

As a plugin-based alternative, you could try Configure SMTP. It "Configure SMTP mailing in WordPress, including support for sending e-mail via SSL/TLS (such as GMail)."

Windows Host Specific: With the plugin mentioned above you can work around the issue of e-mails not being received.

Another alternative is to edit the class-pop3.php file in wp-includes, there is a variable, $MAILSERVER, which allows you to hard code your smtp server. However, wp-php.php in the root directory actually loops through depending on the author to determine a value to set the from address on the e-mail and defaults to the admin address particularly in the case of users registering.

This is fine if your admin address is a valid e-mail address. For example, if your admin e-mail is: admin@"yourhost.com", your smtp server must also be smtp."yourhost.com". If the domains do not match your mail will not send. (Your SMTP server may not require authentication however, your host in most cases still checks to make sure incoming SMTP traffic is still valid. This is to prevent spam.)

When using the plugin wpPHPMailer the same applies, and there is an option to hard code the from address.

How do I get the Quicktag <!--nextpage--> back?

For some reason, the <!--nextpage--> Quicktag button was "removed" in 1.5.1. To get it back, just do the following:

In Wordpress 1.5.x

Open wp-admin/quicktags.js in a text editor and locate this section (starting at line 135):

/*
edButtons[edButtons.length] =
new edButton('ed_next'
,'page'
,'<!--nextpage-->'
,''
,'p'
,-1
);
*/

Just remove the /* and */ lines to uncomment the block of code. That should return the button to your editing windows.

In Wordpress 2.0.x

Open wp-includes/js/quicktags.js in a text editor and locate this section (starting at line 135):

//
edButtons[edButtons.length] =
new edButton('ed_next'
,'page'
,'<!--nextpage-->'
,''
,'p'
,-1
);
//

Just remove the two // lines after and before the block of code to uncomment it.

Now Open 'wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js in a text editor and locate this section (starting at line 15):

var buttons = '<a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpressmore\')" target="_self" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpressmore\');return false;"><img id="{$editor_id}_wordpress_more" src="{$pluginurl}/images/more.gif" title="'+titleMore+'" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a>';
// Add this to the buttons var to put the Page button into the toolbar.
// '<a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpresspage\')" target="_self" onclick="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpresspage\');return false;"><img id="{$editor_id}_wordpress_page" src="{$pluginurl}/images/page.gif" title="'+titlePage+'" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a>';

On line 17 copy the text between the apostrophes and paste it at the end of line 15 exactly before the trailing '; as follows:

var buttons = '<a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpressmore\')" target="_self" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpressmore\');return false;"><img id="{$editor_id}_wordpress_more" src="{$pluginurl}/images/more.gif" title="'+titleMore+'" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a> <a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpresspage\')" target="_self" onclick="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpresspage\');return false;"><img id="{$editor_id}_wordpress_page" src="{$pluginurl}/images/page.gif" title="'+titlePage+'" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a>';

This will show the the Quicktag <!--nextpage--> again. You can also enable the hotkey access by doing just one more thing. Open 'wp-includes/js/tinymce/plugins/wphelp/editor_plugin.js with a text editor. Note that it's not the same file as the one from the previous step, as although it has the same name it is on a different path. Locate the following lines (should be line 23 and 24):

+ '<input type="button" accesskey="t" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpressmore\');" />'
+ '<input type="button" accesskey="u" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Undo\',false);" />'

Copy line 23, paste it as a new line just below line 23, and edit it as follows:

+ '<input type="button" accesskey="t" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpressmore\');" />'
+ '<input type="button" accesskey="p" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpresspage\');" />'
+ '<input type="button" accesskey="u" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Undo\',false);" />'

This will enable the Alt+P shortcut for the <!--nextpage--> tag.

I used the Quicktag <!--nextpage--> in a post so why doesn't it work?

In some Themes, such as the WordPress Classic Theme, you may see the <!--nextpage--> work properly on your main page, but other Themes, such as the WordPress default Theme, may only show the page break when viewing the posts individually. It may be necessary to change your Theme's template page.php or index.php file to make this feature work according to your wishes. You'll need to add the following:

<?php wp_link_pages(); ?> ?

MySQL Error 28

You get the following error:

Error code 28: No space left on device

This is a MySQL error and has nothing to do with WordPress directly; you should contact your host about it. Some users have reported that running a "repair table" command in phpMyAdmin fixed the problem.

Error 28, and how to avoid it:

If you get this error, check all filesystems in 
which MySQL operates. If you followed recommendations 
to split datadir, tmpdir and log files into dedicated 
filesystems, more than one filesystem is involved. In 
addition, be aware that MySQL often creates temporary 
tables for some queries. Most of these are placed in 
tmpdir; however, some may be found in the database 
directory (e.g. ALTER TABLE). Also, ensure that 
sufficient free disk space is available for MySQL.

It could be because:

  • you are out of space on /tmp (wherever tmpdir is), or,
  • you have too many files in /tmp (even if there is lots of free space)

Relevant discussion threads:

Why are the Quote Marks escaped or not escaped?

If you write plugins, or use a plugin like RunPHP, or make advanced custom templates, you may eventually find yourself dealing with data in the database. WordPress usually manages this data for you in such a way that it is immediately usable. There are circumstances though (especially if you are dealing directly with the database without using WordPress) where you will experience weirdness.

For example, quote marks cannot be stored directly in the MySQL database. MySQL uses quote marks in its SQL language. When a quote mark is used, for example, in a post, When the post is saved to the database, every quote mark gets escaped. That means a backslash character is prepended, which signifies that the next character should be taken as part of the input, and not as part of the SQL command.

For example, if you are adding the following in your post:

...an article about "Happiness" is at 
<a href="http://example.com/happy" title="Happiness">Happiness</a>
if you would like to read it...

Is actually imported into the database looking like this:

...an article about \"Happiness\" is at 
<a href=\"http://example.com/happy\" title=\"Happiness\">Happiness</a>
if you would like to read it...

When pulling data out of the database, the backslashes may not always be automatically removed. If this becomes an issue, you can use the stripslashes() PHP function on the text.

Why do I get a blank page when I submit a comment?

Description: When anyone tries to comment on a post, the window goes blank and the comment doesn't appear to have been recognised by WordPress.

Reason and Solution: The Theme that you are using is missing a critical part of the comment form so WordPress doesn't know which post the comment refers to. You need to check the comment.php in your Theme and ensure that the following code appears within the form.

<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />

Relevant discussion threads:

Como desativar todos os plugins quando não poder acessar os menus administrativos?

Às vezes pode ser necessário desativar todos os plugins, mas você não pode acessar os menus administrativa para fazê-lo. Um dos dois métodos estão disponíveis para desativar todos os plugins.

  • Use phpMyAdmin
    • Na tabela wp_options, na coluna option_name encontre active_plugins
    • Mude option_value para: a:0:{}

ou

  • Crie uma pasta de plugins vazia
    • via FTP ou o painel de controle do host, navegue até a pasta wp-contents (diretório)
    • Via FTP ou painel de controle do seu servidor, renomeie a pasta plugins para plugins.hold
    • via FTP ou o painel de controle do host, crie uma nova pasta chamada plugins
    • Entre para em menus de administração do WordPress
    • Via FTP ou painel de controle do seu host, exclua a pasta vazia plugins que você criou anterior
    • Via FTP ou no painel do seu servidor, renomeie plugins.hold de volta para plugins

Como limpar o "brevemente disponível para manutenção programada" exibido após fazer o upgrade automático?

Como parte da atualização automática do WordPress coloca um arquivo chamado .manutenção na pasta base do blog (pasta que contém a pasta wp-admin). Se esse arquivo existir, então vistantes verão a mensagem brevemente indisponível para manutenção programada. Verifique novamente em um minuto.

Para remover esta mensagem, basta apagar o arquivo . manutenção . A atualização automática deve ser executado novamente, apenas no caso de falha.

Como corrigir o erro 404 quando usar Links Legíveis?

Se um erro 404 ocorre quando utilizar Links Permanentes como Dia e Nome em Configurações > Links Permanentes poderia ser um resultado do módulo mod_rewrite não está ativado ou instalado. A solução é ativar mod_rewrite para o servidor web Apache. Verifique a linha `# LoadModule rewrite_module modules/mod_rewrite.so e apague o # na frente da linha. Em seguida, pare o Apache e inicie novamente. Nota: você pode ter que perguntar ao seu serviço de hospedagem para ativar o mod_rewrite.

Veja também:

Why isn't the admin user listed as an author when editing posts?

Not sure why this problem happens, but here's a couple of things to try one of these two solutions.

This usually fixes the problem:

  1. Create new admin user (e.g. newadmin) with Administrator Role
  2. Login as 'newadmin'
  3. Degrade the old 'admin' user to Role of Subscriber and Save
  4. Promote the old 'admin' back to Administrator Role and Save
  5. Login as the old 'admin'

If that doesn't work, try:

  1. Create a new admin user (e.g. newadmin) with Administrator Role
  2. Login as 'newadmin'
  3. Delete the old 'admin' user and assign any posts to 'newadmin'
  4. Create 'admin' user with Administrator Role
  5. Login as 'admin'
  6. Delete 'newadmin' user and assign posts to 'admin'

Why is the wrong author name displayed for a post on a blog?

This problem is usually solved by the same solution as is presented in the question right before this one: Why isn't the admin user listed as an author when editing posts?

An update was just released, so why does my blog not recognize the update is available?

When an update is released, notification of that release is displayed at the top administration panels saying WordPress x.x.x is available! Please update now. Not every blog will see that message at the same time. Your blog is programmed to check for updates every 12 hours, but the timing of that check is purely random. So if your blog just checked for updates minutes before an update was released, you won't see the update message until your blog checks for updates 12 hours later.

If you want your blog to check right now for updates, you can delete the update_core option name record in your wp_options table. Note that plugins and themes each have their own check and update cycle, controlled by the records update_plugins and update_themes, in wp_options.

Relevant discussion thread:


Why did I lose custom changes to the WordPress Default Theme during the last automatic upgrade?

A core upgrade copies all the new files from the distribution over the old ones, so if you changed existing files in the WordPress Default Theme (e.g. wp-content/themes/default/style.css), those changes got overwritten with the new version of that file.

Please note, a core upgrade goes through a list of "old files", as defined in wp-admin/includes/update-core.php, and deletes those files. Any files not on the list, and not in the distribution, are preserved.

Remember, that before upgrades, whether automatic or manual, both the WordPress Files and database should be backed-up as explained in WordPress Backups.

See also:

How do you repair a MySQL database table?

Every once in a while, it may be necessary to repair one or more MySQL database tables. According to the How to Repair Tables article at dev.mysql.com there are a number of reasons to repair a table including errors such as "tbl_name.frm is locked against change", "Can't find file tbl_name.MYI (Errcode: nnn)", "Unexpected end of file", "Record file is crashed", or "Got error nnn from table handler".

Here are the steps to repair a table in a MySQL database using phpMyAdmin:

  1. Login to hosting account.
  2. Login to phpMyAdmin.
  3. Choose the affected database. If you only have one database, it should choose it by default so you don't need to do anything.
  4. In the main panel, you should see a list of your database tables. Check the boxes by the tables that need repair.
  5. At the bottom of the window just below the list of tables, there is a drop down menu. Choose "Repair Table"

Remember, that it is advisable to have a current backup of your database at all times.

See also:

A documentação do WordPress em Português do Brasil.
Todas as comunidades lusófonas também são bem-vindas! Adicione {{Codex-pt}} em seus artigos.
WordCamp Belo Horizonte 2014
WordCamp é um evento com palestras, trocas de experiências sobre web e claro: o encontro de pessoas que usam o WordPress e adoram!
Visite o site do evento para saber mais