Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter davidtrebacz

    (@davidtrebacz)

    Looking at this closer, this plugin (and others) uses the guid field in the posts table to get the image path and name.

    In my case this still contains the old filename. The current image filename is in the posts wp_postmeta table in with an meta_key filed of either _wp_attached_file or _wp_attachment_metadata. For each of those the correct filename in reflected in the meta_value field. The one labeled _wp_attached_file is a clean version of the filename.

    I hacked the current plugin SQL query with this SQL query and I seem to get the correct filenames output:

    $udinra_posts = $wpdb->get_results(“SELECT post_title, post_excerpt, post_parent, guid AS old_guid,CONCAT(‘https://www.glasshousestore.com/wp-content/uploads/’,meta_value) AS guid
    FROM $wpdb->posts LEFT OUTER JOIN $wpdb->postmeta ON $wpdb->posts.ID = wp_postmeta.post_id
    WHERE wp_postmeta.meta_key = ‘_wp_attached_file’ AND post_type = ‘attachment’ AND post_mime_type LIKE ‘image%’ AND post_parent > 0
    ORDER BY post_date DESC;”);

    I join the meta table with the post table. I’m sure there is a more elegant way to do the concat, but I’m better with SQl than php and WordPress.

    Thread Starter davidtrebacz

    (@davidtrebacz)

    Was the change above addressed in the latest code update?

    Plugin Author Udinra

    (@udinra)

    Current version of the plugin should fix this problem.Please test and let me know

    Thread Starter davidtrebacz

    (@davidtrebacz)

    All the issues seem to be resolved in the latest update. Thanks…

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘404 and Missing Images from sitemap’ is closed to new replies.