{"id":965,"date":"2025-03-24T14:28:09","date_gmt":"2025-03-24T14:28:09","guid":{"rendered":"https:\/\/wpgeodirectory.com\/documentation\/article\/exporting-listing-permalinks-as-part-of-the-export-csv-file\/"},"modified":"2025-04-03T15:24:30","modified_gmt":"2025-04-03T14:24:30","slug":"exporting-listing-permalinks-as-part-of-the-export-csv-file","status":"publish","type":"gd_place","link":"https:\/\/wpgeodirectory.com\/documentation\/article\/code-snippets\/exporting-listing-permalinks-as-part-of-the-export-csv-file\/","title":{"rendered":"Exporting Listing permalinks as part of the export CSV file"},"content":{"rendered":"\n<div class=\"wp-block-blockstrap-blockstrap-widget-alert d-flex align-items-center fade show alert alert-info mb-3\" role=\"alert\"><span class=\"fas fa-info-circle me-2\"><\/span><span class=\"flex-grow-1\"><strong>Include the URL or permalink of the detail page<\/strong> for each listing when exporting listings.<\/span><\/div>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-wMHm5UiPtQ.png\" alt=\"\"\/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>This code, if added using the <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/useful-plugins\/code-snippets-plugin\/\">Code Snippets plugin<\/a>, will add an <strong>extra column with&nbsp;<\/strong><strong>the URL or permalink for each listing<\/strong> when you <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/explore-settings\/settings-overview-for-import-export-listings\/\">export your listings<\/a>:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-php\">\/**\n * Export listing url in CSV file.\n *\/\nfunction gd_snippet_200814_export_posts_csv_row( $post_info, $post_ID, $post_type ) {\n\t$post_info&#091;&#039;post_url&#039;&#093; = get_permalink( $post_ID );\n\n\treturn $post_info;\n}\nadd_filter( &#039;geodir_export_posts_csv_row&#039;, &#039;gd_snippet_200814_export_posts_csv_row&#039;, 20, 3 );\n\nfunction gd_snippet_200814_export_posts_csv_columns( $columns, $post_type ) {\n\t$columns&#091;&#093; = &#039;post_url&#039;;\n\n\treturn $columns;\n}\nadd_filter( &#039;geodir_export_posts_csv_columns&#039;, &#039;gd_snippet_200814_export_posts_csv_columns&#039;, 20, 2 );<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This code, if added using the Code Snippets plugin, will add an extra column with&nbsp;the URL or permalink for each listing when you export your listings:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"article\/tags":[],"article\/categories":[211,433],"class_list":["post-965","gd_place","type-gd_place","status-publish","hentry","gd_placecategory-tips-tricks-more","gd_placecategory-code-snippets"],"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/965","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/types\/gd_place"}],"author":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/comments?post=965"}],"version-history":[{"count":0,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/965\/revisions"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/media?parent=965"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/tags?post=965"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/categories?post=965"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}