• haimsr

    (@haimsr)


    Hello,
    Can anyone tell me if it is possible to export the links to the media files from the media library to an excel file or something similar?

    Basically I want a list of the urls to each media file in my media library.

    Thank you in advance!

Viewing 1 replies (of 1 total)
  • Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Hi @haimsr

    I’m not sure how comfortable you with code but I did see this method: https://wordpress.stackexchange.com/a/222640

    It would be adding some code to either a plugin or theme and then either displaying it or saving it somewhere.

    
    function get_the_file_urls( ) {
        $query_media_urls = array(
                'post_type'      => 'attachment',
                'post_status'    => 'inherit',
                'posts_per_page' => - 1,
        );
    
        $query_urls = new WP_Query( $query_media_urls );       
    
        foreach ( $query_urls->posts as $url ) {            
            echo '<ul>' . '<li>' . wp_get_attachment_url( $url->ID ) . '</li>' . '</ul>';
        }
    }
    
Viewing 1 replies (of 1 total)

The topic ‘Media Files – Links’ is closed to new replies.