Title: Setting the link through SQL or a PHP function
Last modified: August 30, 2016

---

# Setting the link through SQL or a PHP function

 *  [ronenlh](https://wordpress.org/support/users/ronenlh/)
 * (@ronenlh)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/setting-the-link-through-sql-or-a-php-function/)
 * I’m currently writing a script to create a series of posts in WP.
 * I want them to redirect to a speciffic URL with Page Links To, but I don’t know
   how to set the link without having to open every single post and setting it with
   the plug-in GUI.
 * Is there a programmatic way of setting the link from outside the post editor?
 * Many thanks.
 * [https://wordpress.org/plugins/page-links-to/](https://wordpress.org/plugins/page-links-to/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Webbverkstaden](https://wordpress.org/support/users/webbverkstaden/)
 * (@webbverkstaden)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/setting-the-link-through-sql-or-a-php-function/#post-6685533)
 * I would be interested in this as well.
 *  [bobbycircle](https://wordpress.org/support/users/bobbycircle/)
 * (@bobbycircle)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/setting-the-link-through-sql-or-a-php-function/#post-6685575)
 * This is my question also.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Setting the link through SQL or a PHP function’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/page-links-to_fafafa.svg)
 * [Page Links To](https://wordpress.org/plugins/page-links-to/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/page-links-to/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/page-links-to/)
 * [Active Topics](https://wordpress.org/support/plugin/page-links-to/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/page-links-to/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/page-links-to/reviews/)

## Tags

 * [script](https://wordpress.org/support/topic-tag/script/)

 * 2 replies
 * 3 participants
 * Last reply from: [bobbycircle](https://wordpress.org/support/users/bobbycircle/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/setting-the-link-through-sql-or-a-php-function/#post-6685575)
 * Status: not resolved