Quem trabalha com WordPress, pelo menos uma, já tentou se matar de tanta raiva ao utilizar thumbnails com formatos personalizados. Pois é, tem horas que o WordPress fica maluco e nem Chuck Norris consegue exibir os thumbnails corretamente…

Force Regenerate Thumbnails

Baseado no plugin Regeneration Thumbnails de Viper007bond, o Force Regenerate Thumbnails tem uma proposta diferente, uma vez que ele apaga todos os thumbnails antigo e REALMENTE gera NOVOS thumbnails.

Em alguns trabalhos, sempre que eu inventei moda tentando alterar a ordem das declarações add_image_size ou adicionar novos formatos de thumbnails, o WordPress ficou maluco.

Executava diversas vezes o plugin Regenerate Thumbnails e nada… mudava os tamanhos e executava novamente e nada também… alguns eram corrigidos mas outros não. Enfim… tenho certeza que se você não passou por isso, já viu algum tópico de um desesperado sobre o assunto.

Compatibilidade

  • Compatível com WordPress 2.8+

Instalação

Baixe o plugin no GitHub ou no repositório do WordPress.

Descompacte os arquivos, faça o upload da pasta em /wp-content/plugins/ e ative o plugin.

Utilização

Você pode regenerar os thumbnails de todas as imagens do website através do menu Ferramentas -> Force Regenerate Thumbnails, ou se preferir pode regenerar apenas de imagens específicas através da Biblioteca de Mídias.

Telas

Conclusão

“Seus problemas acabaram-se!!!” =D

Valeu! Até a próxima!

Quer copiar esse post no seu site? Você pode!

Segundo a licença da Creative Commons 3.0 (CC BY SA 3.0) você pode copiar e distribuir esse conteúdo desde que faça menção ao autor original, para isso é só copiar esse código no final do artigo quando for publicá-lo em seu site:

<p>Artigo originalmente publicado em <em>15 de agosto de 2012</em> por <strong><a href="http://pedroelsner.com/" title="Pedro Elsner, Profissional de TI - São Paulo">Pedro Elsner</a></strong>: <a href="http://pedroelsner.com/2012/08/forcando-a-atualizacao-de-thumbnails-no-wordpress/" title="Forçando a atualização de thumbnails no WordPress">Forçando a atualização de thumbnails no WordPress</a></p>
A não menção ao autor original da obra implicará em cópia e/ou distribuição ilegal de propriedade intelectual, o que é crime segundo a Lei n.º 9.610.
  • Martin

    Thanks Pedro, I love this plugin!! 🙂

  • marcioellobo

    Valeu velho Pedro, you’re the man!

  • Rafael Martinez

    Hi, I got a problem, always receive this error in all files:

    unction (){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);”function”===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&”string”!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this}

    Why? Thanks!

  • amazing. After struggling to find out why my thumbnails were failing on over a dozen sites… I installed Force Generate Thumbnails and just activated it… all my thumbnails including featured images reappeared… coincidence? What’s the magic? Thanks!

  • Thanks Dave!
    The plugin force GD for Image handle
    It’s the secret =)

  • A new version of the plugin is available.
    Please, try again =)

  • Isnt gd a core function/dependency?

  • WP 3.5+ don’t more

  • So thumbnail creation doesnt happen automatically?

  • So, i don’t know the correct reason but in some servers don’t work

  • Pedro, thanks for replying. It seems that /usr/local/lib/php.conf.d# ldd produced many miising imagick libs. In addition, imagick wasn’t playing nice with GD. It was definitely server-specific as you alluded to. Thanks for your attention and a great WordPress plugin!

    David Radovanovic
    WhatsTheBigIdea.com, Inc.
    — Web Design and Graphic Design Services
    100 Dock Street
    Saugerties, NY 12477
    (845) 247-0909
    @thebigdesign

  • David, you are welcome!

  • lauramelos

    hey Pedro, could you please update the github to 1.4 version? thanks!!!

  • bartdingen

    Great plugin, but for a couple of weeks now some of the accounts within WordPress don’t see the ‘Force Regenerate Thumbnails’ in the image library. Is there a solution for this?

  • Hello

    this plugin is not deleting the files i still see the files which it said it deleted.

    please help.

    Thank you

  • You can try re-install the plugin…

  • It just delete and after done regenerate these thumbnails.
    If these thumbnails don’t change, check permissions on the folder wp-content/upload to user www

    Sorry for my english ^^’

  • You mean it delete the thumbnails and generate again as theme commands it ?

    Where do i check for the permissions of the folder?

    Thank you so much your english is fine 🙂

  • Actually problem is my theme creates 15 files per image http://i.imgur.com/P3wpMbR.png.

    And it has long list of code in Post_Thumbnails which has alot of image sizes i dont know which ones to remove. my hosting account is full and im stuck please help.

    need to restrict it to make just 1 or 3 files per image and delete the old image files.

    your help will be greatly appreciated.

  • bartdingen

    I tried that, but it doesn’t work. Some of the accounts still can’t see the link. Others can see it though. Is there some sort of account-limit?

  • Yes! Only administrator users can see the link!

  • @lauramelos github updated to 1.5 version =)

  • @FizX try the new 1.7 version =)

  • xsisted

    Tried the new version and its great but i dont know why and how its creating 150×150 and 150×61 thumbnails when i tried to not to created any copies of the image.

    Tired of trying i dont think it will ever create just one file for each image.

  • Does it support Imagick? Someone said Imagick can make smaller image file.

  • Victor

    Hola Pedro!

    Enhorabuena por tu plugin. Es muy útil para sitios web que tienen muchas imágenes.

    Me gustaría pedirte ayuda porque en mi website tenemos 14.000 imágenes.

    El plugin funciona perfecto, pero cuando llega al 10%, 20% o a veces al 30% del total, se queda parado.

    He probado aumentar a 256MB la memoria interna de wordpress y también la del servidor, pero no ha habido suerte.

    Podrías ayudarme?

    Muito obrigado 🙂

  • Leigh

    Hi! Will it work ok for woocommerce thumbnails? Thank you!

  • Dear Pedro
    Thank you for spending so much effort into this plugin.
    After using the plugin, the images that I resized don’t appear any more.
    My goal was to resize the thumbnails in the portfolio-grid.
    First I changed functions.php, then I used you plugin to resize. Even if I change the featured image of a post, I can’t get back the images.
    Do you have an idea how to solve my problem?
    Any suggestion is very much appreciated!
    Best regards

  • Pedro,
    after removing the portfolio from visual composer and redo the work i got the images back.
    Thanks anyways!
    regards

  • me parece genial que elimine los viejos, pero desgraciadamente crea nuevos thumbnails que no necesito, en algunos casos solo necesitaba regenerar las miniaturas mas pequeñas y me creo hasta 5 archivos adicionales que no hacen mas que ocupar espacio en el servidor.

    Deleted: 162×162, 470×220
    (2 imagenes que tenía)
    Regenerate: 160×160, 256×256, 312×289, 341×276, 720×337
    (ahora tengo 5 imágenes, cuando solo tengo configurado generar una miniatura de 160×160 de dónde saca las otras 4?)

  • Need to force regenerate on a single image from the image editor… We have >5000 images so it is impractical to try to find the specific image from the media list and impossible to regenerate them all without crashing the site. Doesn’t look like this plugin has that capability.